def get_stats(self, hashable=False): """ :param hashable: if hashable, return tuple instead of attacks-dict :return: attacks, structure, shields """ if not hashable: return self.attacks, self.structure, self.shields else: return dict_to_tuple(self.attacks), self.structure, self.shields
def __hash__(self): return hash( (dict_to_tuple(self.attacks), self.structure, self.shields))