def set_color(self, stone: str): if self.stone in STONE: raise StoneException("Player is already registered") if stone not in STONE: raise StoneException("Invalid Stone in Player") self.stone = stone
def get_color(self): if self.stone: return self.stone else: raise StoneException("Player color has not been set")
def check_stone(Stone: str, Operation: str = ""): if Stone not in STONE: raise StoneException("Invalid Stone - cannot perform {} operation for stone: {}".format(Operation, Stone))
def get_stone(self): if self.received: return self.player.get_stone() else: raise StoneException("Player has no stones")
def receive_stones(self, stone: str): if stone not in STONE: raise StoneException("Invalid Stone in Player") self.stone = stone
def set_stone(self, stone: str): if not self.registered: raise PlayerException("Player has not been registered yet") if stone not in STONE: raise StoneException("Invalid Stone in Player") self.stone = stone
def check_stone(Stone: str, Operation: str = ""): if (Stone not in STONE): raise StoneException("Invalid Stone - cannot perform " + Operation + " operation")