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"
예제 #3
0
파일: store.py 프로젝트: cnelsonsic/garden
    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)
예제 #4
0
 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
예제 #5
0
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"
예제 #8
0
    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
예제 #9
0
 def __init__(self):
     Plant.__init__(self, "Mountain Apple Tree", ["mountain"])
     Identifiable.__init__(self)
예제 #10
0
 def __init__(self):
     Plant.__init__(self, "Rainbow Eucalyptus Tree", ["forest"])
     Identifiable.__init__(self)
예제 #11
0
 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")
예제 #13
0
 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)
예제 #16
0
 def __init__(self):
     Plant.__init__(self, "Silversword", "shade", 22, "high")
     self.add_location("grasslands")
예제 #17
0
 def __init__(self):
     Plant.__init__(self, "Rainbow Eucalyptus Tree", "Full", 8, "low")
     ICanopy.__init__(self)
     Identifiable.__init__(self)
예제 #18
0
 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()
예제 #20
0
 def __init__(self):
     Plant.__init__(self, "Sesame", "partial", 17, "high")
     self.add_location("plowedFields")
     self.add_location("naturalFields")
예제 #21
0
 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)
예제 #24
0
 def __init__(self):
     Plant.__init__(self)
     Identifiable.__init__(self)
     GrasslandPlant.__init__(self)
     self.sunlight = "full"
     self.species = "Silversword"
예제 #25
0
 def __init__(self):
     Plant.__init__(self, "Blue Jade Vine", ["grassland", "swamp"])
     Identifiable.__init__(self)
예제 #26
0
 def __init__(self):
     Plant.__init__(self, "Rainbow Eucalyptus Tree", "full", 8, "low")
     self.add_location("forests")
예제 #27
0
 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"]