def validate_attributes(self):
     """
     Validates the attributes of this PlayerState
     :raise AssertionError if any attributes are out of bounds
     """
     assert(isinstance(self.name, int) and self.name >= MIN_PLAYER_ID)
     assert(isinstance(self.food_bag, int) and self.food_bag >= MIN_FOOD_BAG)
     assert(isinstance(self.hand, list))
     TraitCard.validate_all_attributes(self.hand)
     assert(isinstance(self.species, list))
     Species.validate_all_attributes(self.species)
 def validate_attributes(self):
     """
     Validates the attributes of this Dealer
     :raise AssertionError if any attributes are out of bounds
     """
     assert (isinstance(self.list_of_players, list)
             and LOP_MAX >= len(self.list_of_players) >= LOP_MIN)
     PlayerState.validate_all_attributes(self.list_of_players)
     assert (isinstance(self.watering_hole, int)
             and self.watering_hole >= MIN_WATERING_HOLE)
     assert (isinstance(self.deck, list) and LOC_MAX >= len(self.deck))
     TraitCard.validate_all_attributes(self.deck)
Beispiel #3
0
 def validate_attributes(self):
     """
     Validates the attributes of this Species
     :raise AssertionError if any attributes are out of bounds
     """
     assert(isinstance(self.population, int) and MAX_POP >= self.population >= MIN_POP)
     assert(isinstance(self.food, int) and MAX_FOOD >= self.food >= MIN_FOOD)
     assert(isinstance(self.body, int) and MAX_BODY >= self.body >= MIN_BODY)
     assert(all([isinstance(self.traits, list), MAX_TRAITS >= len(self.traits),
                 len(self.trait_names()) == len(set(self.trait_names()))]))
     TraitCard.validate_all_attributes(self.traits)
     if self.fat_storage is not False:
         assert(isinstance(self.body, int) and self.body >= self.fat_storage >= MIN_FATFOOD)