Esempio n. 1
0
	def __init__(self, quantity):
		"""
			Initializes food creating a dictionary with tuple positions as keys and 
			food types as values

			Parameter quantity is the ammount of food to generate
		"""
		self.food = {}

		for i in range(quantity):
			self.food[Environment_s.foodpos()] = Environment_s.def_food
Esempio n. 2
0
	def add(self, quantity, position = None, world_age = None, food_type = Environment_s.def_food):
		"""
			Generates one of food in a determined position or [quantity] of the given type
			on the position returned by the function on the settings
		"""
		if position != None:
			self.food[position] = food_type
			return

		for i in range(quantity):
			position = Environment_s.foodpos(world_age)
			self.food[position] = food_type