45 lines
984 B
Python
45 lines
984 B
Python
import pygame
|
|
|
|
class Player:
|
|
__id:int
|
|
__hp:int
|
|
__mana:int
|
|
__name:str
|
|
__handCards:pygame.sprite.Group
|
|
|
|
def __init__(self, hp:int, mana:int, name:str, id:int):
|
|
self.__hp = hp
|
|
self.__mana = mana
|
|
self.__name = name
|
|
self.__id = id
|
|
|
|
def setID(self, id:int):
|
|
self.__id = id
|
|
|
|
def getID(self) -> int:
|
|
return self.__id
|
|
|
|
def getName(self) -> str:
|
|
return self.__name
|
|
|
|
def getHP(self) -> int:
|
|
return self.__hp
|
|
|
|
def getMana(self) -> int:
|
|
return self.__mana
|
|
|
|
def adjustHP(self, hp:int) -> int:
|
|
self.__hp = self.__hp + hp
|
|
|
|
def getHand(self) -> pygame.sprite.Group:
|
|
return self.__handCards
|
|
|
|
def AddToHand(self, card) -> pygame.sprite.Group:
|
|
self.__handCards.add(card)
|
|
return self.__handCards
|
|
|
|
def removeFromHand(self, pos:int) -> pygame.sprite.Group:
|
|
self.__handCards.remove(pos)
|
|
return self.__handCards
|
|
|