def __init__(self): ITerrestrial.__init__(self) Plant.__init__(self) self.species = "Mountain Apple Tree" self.tolerate_sun = False self.high_elevation = True self.seeds_produced = 17 self.insecticide_resistance = "High"
def __init__(self): ITerrestrial.__init__(self) Plant.__init__(self) self.species = "Rainbow Eucalyptus Tree" self.tolerate_shade = True self.tolerate_sun = False self.rainfall = "Rainy" self.seeds_produced = 8 self.insecticide_resistance = "Low"
def __init__(self): self._inventory = [] values = [10, ] for _ in range(1, 10): # Values like: 10, 21, 44, 90, 180 or 10, 20, 41, 82, 166 values.append((max(values)*2) + random.randint(0, max(values)/10)) for tier in range(0, 10): plant = Plant() plant.value = values[tier] self._inventory.append(plant)
def __init__(self): ITerrestrial.__init__(self) Plant.__init__(self) self.species = "Silversword" self.tolerate_sun = True self.seeds_produced = 22 self.insecticide_resistance = "High" self.rainfall = "Little" # Was in the original code but doesn't appear to be used # self.peak_season = season
def makePlant(): user_plantName = input('Enter botanical name of plant: ') user_plantCommon = input('Enter common name of plant: ') user_plantSize = input('Size of pot in Gallons(INTEGER): ') user_plantOwner = input('Who owns this plant?: ') #def __init__(self, botanical_name, common_name, pot_size, owner, id): plant2DB = Plant(user_plantName, user_plantCommon, user_plantSize, user_plantOwner, None) # save to db: cursor.execute('INSERT INTO plants (botanical_name, common_name, pot_size, owner) VALUES (%s, %s, %s, %s)', # (self.botanical_name, self.common_name, self.pot_size, self.owner)) plant2DB.save_to_db() print("Added plant to database...") automateDB()
def MyMain(H, W): random.seed(time.time()) environment = Environment(H, W, C.COL_DEFAULT) for AgName in list(C.AGENT_CARACT.keys()): AgCar = C.AGENT_CARACT[AgName] A = AgentGlobal(AgName, Agent(0, 0, AgName, *AgCar[0]), *AgCar[1:]) A.initEnv(environment, C.AGENT_INIT[AgName]) for PlName in list(C.PLANT_CARACT.keys()): PlCar = C.PLANT_CARACT[PlName] P = PlantGlobal(PlName, Plant(0, 0, PlName, PlCar[0]), *PlCar[1:]) P.initEnv(environment, C.PLANT_INIT[PlName]) pygame.init() screen = pygame.display.set_mode((C.PX_SIZE * W, C.PX_SIZE * H), pygame.DOUBLEBUF) screen.fill((0, 0, 0)) disp.DrawMatrix(environment.getColorMatrix(), screen, C.PX_SIZE) # wait till the window is closed clock = pygame.time.Clock() done = False ticker = 0 #used to express time passing in the environment while not done: for event in pygame.event.get(): if event.type == pygame.QUIT: done = True environment.tick(ticker) ticker += 1 disp.DrawMatrix(environment.getColorMatrix(), screen, C.PX_SIZE) # display the backbuffer pygame.display.flip() clock.tick(C.TICK)
def __init__(self): ITerrestrial.__init__(self) IFreshwater.__init__(self) Plant.__init__(self) self.species = "Blue Jade Vine" #Technically, the "Sunlight" entry on the readme says "Partial", # but it also says it lives in grasslands, # which are labeled as having "No Shade" self.tolerate_sun = True # This being set to false by IFreshwater # is not true for this plant if it lives in a swamp self.tolerate_stagnant = True self.seeds_produced = 0 self.insecticide_resistance = "Medium" self.rainfall = "Little"
def collect(self): temp = Plant() temp.totalfood += self.wheat.numEatable temp.totalfood += self.rice.numEatable temp.totalfood += self.onion.numEatable temp.totalfood += self.radish.numEatable self.wheat.numEatable = 0 self.rice.numEatable = 0 self.onion.numEatable = 0 self.radish.numEatable = 0 return temp
def __init__(self): Plant.__init__(self, "Mountain Apple Tree", ["mountain"]) Identifiable.__init__(self)
def __init__(self): Plant.__init__(self, "Rainbow Eucalyptus Tree", ["forest"]) Identifiable.__init__(self)
def __init__(self): Plant.__init__(self, "Blue Jade Vine", "Partial", 0, "Medium") self.hospitable_locations = ["Grassland", "Swamp"]
def __init__(self): Plant.__init__(self, "Sunflower", "partial", 17, "high") self.add_location("plowedFields")
def __init__(self): Plant.__init__(self, "Wildflower", "partial", 17, "high") self.add_location("naturalFields")
def __init__(self): Plant.__init__(self, "Silversword", "Full", 22, "High") self.hospitable_locations = ["Grassland"]
def __init__(self): Plant.__init__(self, "Blue Jade Vine") Identifiable.__init__(self)
def __init__(self): Plant.__init__(self, "Silversword", "shade", 22, "high") self.add_location("grasslands")
def __init__(self): Plant.__init__(self, "Rainbow Eucalyptus Tree", "Full", 8, "low") ICanopy.__init__(self) Identifiable.__init__(self)
def __init__(self): Plant.__init__(self, "Rainbow Eucalyptus") Identifiable.__init__(self)
def load_plants(): basil = Plant(_id='basil', plant_friends=[], plant_foes=[]) cantaloupe = Plant(_id='cantaloupe', plant_friends=[], plant_foes=[]) onion = Plant(_id='onion', plant_friends=[], plant_foes=[]) pepper = Plant(_id='pepper', plant_friends=[], plant_foes=[]) tomato = Plant(_id='tomato', plant_friends=[], plant_foes=[]) basil.save() cantaloupe.save() onion.save() pepper.save() tomato.save()
def __init__(self): Plant.__init__(self, "Sesame", "partial", 17, "high") self.add_location("plowedFields") self.add_location("naturalFields")
def __init__(self): Plant.__init__(self, "Mountain Apple Tree", "partial", 17, "high") self.add_location("mountains")
def __init__(self): Plant.__init__(self) Identifiable.__init__(self) ForestPlant.__init__(self) self.sunlight = "shade" self.species = "Rainbow Eucalyptus Tree"
def __init__(self): Plant.__init__(self, "Silversword") Identifiable.__init__(self)
def __init__(self): Plant.__init__(self) Identifiable.__init__(self) GrasslandPlant.__init__(self) self.sunlight = "full" self.species = "Silversword"
def __init__(self): Plant.__init__(self, "Blue Jade Vine", ["grassland", "swamp"]) Identifiable.__init__(self)
def __init__(self): Plant.__init__(self, "Rainbow Eucalyptus Tree", "full", 8, "low") self.add_location("forests")
def __init__(self): Plant.__init__(self, "Blue Jade Vine", "partial", 0, "Medium")
def __init__(self): Plant.__init__(self) Identifiable.__init__(self) MountainPlant.__init__(self) self.sunlight = "partial" self.species = "Mountain Apple Tree"
def __init__(self): Plant.__init__(self, "Rainbow Eucalyptus Tree", "Shade", 8, "Low" ) self.hospitable_locations = ["Forest"]
def __init__(self): Plant.__init__(self, "Silversword", "shade", 22, "high") Identifiable.__init__(self)
def __init__(self): Plant.__init__(self, "Mountain Apple Tree", "Partial", 17, "High") self.hospitable_locations = ["Mountain"]