Ejemplo n.º 1
0
def species_from_config(config):
    attributes = config['attributes']

    species = Species()
    species.name = config['name']
    species.life_span = attributes['life_span']
    species.monthly_food_consumption = attributes['monthly_food_consumption']
    species.monthly_water_consumption = attributes['monthly_water_consumption']
    species.minimum_temperature = attributes['minimum_temperature']
    species.maximum_temperature = attributes['maximum_temperature']
    species.gestation_months = attributes['gestation_period']
    species.minimum_breeding_age = attributes['minimum_breeding_age']

    return species