Changeset 755

Show
Ignore:
Timestamp:
06/05/2012 11:53:54 AM (23 months ago)
Author:
jhoffswell
Message:

Removed food!

Location:
src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • src/scripts/generateBuildings.py

    r741 r755  
    2828    ################################# Car ################################### 
    2929    carStats = BuildingStats() 
    30     carStats.setOneTime(Spec(-50, 0, -70, 5, 0)) 
    31     carStats.setCont(Spec(0, -20, 0, 0, 10)) 
     30    carStats.setOneTime(Spec(-50, 0, -70, 0)) 
     31    carStats.setCont(Spec(0, -20, 0, 10)) 
    3232    car = Building('car', TRANS, carStats, (0, 0, 0), []) 
    3333    car.setMenuDescrip("A car is a form of transportation.") 
     
    4343    ############################### Motorcycle ################################ 
    4444    motorcycleStats = BuildingStats() 
    45     motorcycleStats.setOneTime(Spec(-50, 0, -70, 0, 0)) 
    46     motorcycleStats.setCont(Spec(0, -10, 0, 0, 10)) 
     45    motorcycleStats.setOneTime(Spec(-50, 0, -70, 0)) 
     46    motorcycleStats.setCont(Spec(0, -10, 0, 10)) 
    4747    motorcycle = Building('motorcycle', TRANS, motorcycleStats, (0, 20, 0), []) 
    4848    motorcycle.setMenuDescrip("A motorcycle is a form of transportation.") 
     
    5858    ################################# Truck ################################### 
    5959    truckStats = BuildingStats() 
    60     truckStats.setOneTime(Spec(-30, 0, -50, 5, 0)) 
    61     truckStats.setCont(Spec(0, -20, 0, 0, 10)) 
     60    truckStats.setOneTime(Spec(-30, 0, -50, 0)) 
     61    truckStats.setCont(Spec(0, -20, 0, 10)) 
    6262    truck = Building('truck', TRANS, truckStats, (0, 20, 0), ['car', 'gas station']) 
    6363    truck.setMenuDescrip("A truck is a form of transportation.") 
     
    7373    ############################## Fire Truck ################################# 
    7474    fireTruckStats = BuildingStats() 
    75     fireTruckStats.setOneTime(Spec(-80, 0, -100, 40, 0)) 
    76     fireTruckStats.setCont(Spec(0, -5, 0, 0, 10)) 
     75    fireTruckStats.setOneTime(Spec(-80, 0, -100, 0)) 
     76    fireTruckStats.setCont(Spec(0, -5, 0, 10)) 
    7777    fireTruck = Building('fire truck', TRANS, fireTruckStats, (0, 20, 0), ['truck']) 
    7878    fireTruck.setMenuDescrip("A fire truck is a form of transportation") 
     
    8888    ################################## Bus #################################### 
    8989    busStats = BuildingStats() 
    90     busStats.setOneTime(Spec(-50, 0, -50, 20, 0)) 
    91     busStats.setCont(Spec(0, -40, 0, 0, 15)) 
     90    busStats.setOneTime(Spec(-50, 0, -50, 0)) 
     91    busStats.setCont(Spec(0, -40, 0, 15)) 
    9292    bus = Building('bus', TRANS, busStats, (0, 20, 0), ['car']) 
    9393    bus.setMenuDescrip("A bus is a form of transportation.") 
     
    103103    ################################# Train ################################### 
    104104    trainStats = BuildingStats() 
    105     trainStats.setOneTime(Spec(-100, 0, -70, 10, 0)) 
    106     trainStats.setCont(Spec(0, -15, 0, 0, 5)) 
     105    trainStats.setOneTime(Spec(-100, 0, -70, 0)) 
     106    trainStats.setCont(Spec(0, -15, 0, 5)) 
    107107    train = Building('train', TRANS, trainStats, (0, 80, 0), ['truck']) 
    108108    train.setMenuDescrip("A train is a form of transportation.") 
     
    118118    ################################# Plane ################################### 
    119119    planeStats = BuildingStats() 
    120     planeStats.setOneTime(Spec(-150, 0, -70, 50, 0)) 
    121     planeStats.setCont(Spec(0, -30, 0, 0, 30)) 
     120    planeStats.setOneTime(Spec(-150, 0, -70, 0)) 
     121    planeStats.setCont(Spec(0, -30, 0, 30)) 
    122122    plane = Building('plane', TRANS, planeStats, (0, 160, 0),['train']) 
    123123    plane.setMenuDescrip("A plane can go really far.") 
     
    133133    ############################### Helicopter ################################ 
    134134    helicopterStats = BuildingStats() 
    135     helicopterStats.setOneTime(Spec(-50, 0, -30, 40, 0)) 
    136     helicopterStats.setCont(Spec(0, -15, 0, 0, 10)) 
     135    helicopterStats.setOneTime(Spec(-50, 0, -30, 0)) 
     136    helicopterStats.setCont(Spec(0, -15, 0, 10)) 
    137137    helicopter = Building('helicopter', TRANS, helicopterStats, (0, 160, 0),['plane']) 
    138138    helicopter.setMenuDescrip("A helicopter is a flying vehicle.") 
     
    149149    ############################### Spaceship ################################# 
    150150    spaceshipStats = BuildingStats() 
    151     spaceshipStats.setOneTime(Spec(-200, 0, -100, -80, 0)) 
    152     spaceshipStats.setCont(Spec(0, -40, 0, 0, 100)) 
     151    spaceshipStats.setOneTime(Spec(-200, 0, -100, 0)) 
     152    spaceshipStats.setCont(Spec(0, -40, 0, 100)) 
    153153    spaceship = Building('spaceship', TRANS, 
    154154                         spaceshipStats, (0, 240, 0),['plane', 'solar panel']) 
     
    167167     
    168168    windmillStats = BuildingStats() 
    169     windmillStats.setOneTime(Spec(-50, 0, -40, -30, 0)) 
    170     windmillStats.setCont(Spec(0, 10, 0, 0, 0)) 
     169    windmillStats.setOneTime(Spec(-50, 0, -40, 0)) 
     170    windmillStats.setCont(Spec(0, 10, 0, 0)) 
    171171    windmill = Building('windmill', POWER, windmillStats, (10, 0, 0),[]) 
    172172    windmill.setMenuDescrip("Windmill uses wind to create power.") 
     
    182182    ############################ Gas Station ################################## 
    183183    gasStationStats = BuildingStats() 
    184     gasStationStats.setOneTime(Spec(-80, -20, -40, -20, 0)) 
    185     gasStationStats.setCont(Spec(0, 10, 0, 0, 10)) 
     184    gasStationStats.setOneTime(Spec(-80, -20, -40, 0)) 
     185    gasStationStats.setCont(Spec(0, 10, 0, 10)) 
    186186    gasStation = Building('gas station', POWER, gasStationStats, (20, 0, 0), 
    187187                          []) 
     
    198198    ############################ Solar Panel ################################## 
    199199    solarPanelStats = BuildingStats() 
    200     solarPanelStats.setOneTime(Spec(-30, 0, -30, -20, 0)) 
    201     solarPanelStats.setCont(Spec(0, 20, 0, 0, 0)) 
     200    solarPanelStats.setOneTime(Spec(-30, 0, -30, 0)) 
     201    solarPanelStats.setCont(Spec(0, 20, 0, 0)) 
    202202    solarPanel = Building('solar panel', POWER, solarPanelStats, (50, 0, 0), 
    203203                          ['windmill']) 
     
    214214    ############################ Water Wheel ################################## 
    215215    waterWheelStats = BuildingStats() 
    216     waterWheelStats.setOneTime(Spec(-80, 0, -20, -20, 0)) 
    217     waterWheelStats.setCont(Spec(0, 20, 0, 0, 0)) 
     216    waterWheelStats.setOneTime(Spec(-80, 0, -20, 0)) 
     217    waterWheelStats.setCont(Spec(0, 20, 0, 0)) 
    218218    waterWheel = Building('water wheel', POWER, waterWheelStats, (70, 0, 0), 
    219219                          ['windmill']) 
     
    230230    ############################ Nuclear Plant ################################ 
    231231    nuclearPlantStats = BuildingStats() 
    232     nuclearPlantStats.setOneTime(Spec(-200, 0, -50, -30, 0)) 
    233     nuclearPlantStats.setCont(Spec(0, 50, 0, 0, 40)) 
     232    nuclearPlantStats.setOneTime(Spec(-200, 0, -50, 0)) 
     233    nuclearPlantStats.setCont(Spec(0, 50, 0, 40)) 
    234234    nuclearPlant = Building('nuclear plant', POWER, 
    235235                            nuclearPlantStats, (160, 0, 0),[]) 
     
    248248     
    249249    mineStats = BuildingStats() 
    250     mineStats.setOneTime(Spec(-60, 0, -20, -30, 0)) 
    251     mineStats.setCont(Spec(0, 0, 25, 0, 15)) 
     250    mineStats.setOneTime(Spec(-60, 0, -20, 0)) 
     251    mineStats.setCont(Spec(0, 0, 25, 15)) 
    252252    mine = Building('mine', MAT, mineStats, (0, 0, 0),[]) 
    253253    mine.setMenuDescrip("Mines are used to get material.") 
     
    263263    ############################### Tree ##################################### 
    264264    treeStats = BuildingStats() 
    265     treeStats.setOneTime(Spec(-30, 0, 0, -10, 0)) 
    266     treeStats.setCont(Spec(0, 0, 5, 0, -10)) 
     265    treeStats.setOneTime(Spec(-30, 0, 0, 0)) 
     266    treeStats.setCont(Spec(0, 0, 5, -10)) 
    267267    tree = Building('tree', MAT, treeStats, (0, 0, 0),[]) 
    268268    tree.setMenuDescrip("Trees reduce pollution and provide materials.") 
     
    278278    ############################## Factory ################################### 
    279279    factoryStats = BuildingStats() 
    280     factoryStats.setOneTime(Spec(-60, 0, -40, -30, 0)) 
    281     factoryStats.setCont(Spec(0, 0, 60, 0, 40)) 
     280    factoryStats.setOneTime(Spec(-60, 0, -40, 0)) 
     281    factoryStats.setCont(Spec(0, 0, 60, 40)) 
    282282    factory = Building('factory', MAT, factoryStats, (0, 0, 60),['mine']) 
    283283    factory.setMenuDescrip("Factories are used to get lots of material.") 
     
    293293    ################################ Farm ##################################### 
    294294    farmStats = BuildingStats() 
    295     farmStats.setOneTime(Spec(-50, 0, 0, 0, 0)) 
    296     farmStats.setCont(Spec(0, 0, 10, 0, 5)) 
     295    farmStats.setOneTime(Spec(-50, 0, 0, 0)) 
     296    farmStats.setCont(Spec(0, 0, 10, 5)) 
    297297    farm = Building('farm', MAT, farmStats, (0, 0, 60),['tree']) 
    298298    farm.setMenuDescrip("Farms are used to get materials.") 
  • src/spec.py

    r675 r755  
    99from globals import * 
    1010 
    11 specList = ["money", "power", "material", "food", "pollution"] 
     11specList = ["money", "power", "material", "pollution"] 
    1212 
    1313 
    1414class Spec(): 
    15     def __init__(self, money=0, power=0, material=0, 
    16                  food=0, pollution=0): 
     15    def __init__(self, money=0, power=0, material=0, pollution=0): 
    1716        """ 
    1817            initializes a Spec with the given values 
    1918 
    20             input type: int(money), int(power), int(material), 
    21                         int(food), int(pollution) 
     19            input type: int(money), int(power), int(material), int(pollution) 
    2220        """ 
    2321        self.money = money 
    2422        self.power = power 
    2523        self.material = material 
    26         self.food = food 
    2724        self.pollution = pollution 
    2825 
     
    9794        """ 
    9895        self.material = newMaterial 
    99  
    100     def getFood(self): 
    101         """ 
    102             returns the amount of food 
    103  
    104             input type: None 
    105             return type: int(self.food) 
    106         """ 
    107         return self.food 
    108  
    109     def setFood(self, newFood): 
    110         """ 
    111             changes the food stat of the spec 
    112  
    113             input type: int(newFood) 
    114             return type: None 
    115         """ 
    116         self.food = newFood 
    11796 
    11897    def getPollution(self): 
     
    142121                        (str('power'), int(self.power), bool(isBad)) 
    143122                        (str('material'), int(self.material), bool(isBad))) 
    144                         (str('food'), int(self.food), bool(isBad)) 
    145123                        (str('pollution'), int(self.pollution), bool(isBad)) 
    146124        """ 
     
    148126                ('power', self.power, False), 
    149127                ('material', self.material, False), 
    150                 ('food', self.food, False), 
    151128                ('pollution', self.pollution, True)] 
    152129 
     
    161138        self.setPower(self.getPower() - otherSpec.getPower()) 
    162139        self.setMaterial(self.getMaterial() - otherSpec.getMaterial()) 
    163         self.setFood(self.getFood() - otherSpec.getFood()) 
    164140        self.setPollution(self.getPollution() - otherSpec.getPollution()) 
    165141        return self 
     
    175151        self.setPower(self.getPower() + otherSpec.getPower()) 
    176152        self.setMaterial(self.getMaterial() + otherSpec.getMaterial()) 
    177         self.setFood(self.getFood() + otherSpec.getFood()) 
    178153        self.setPollution(self.getPollution() + otherSpec.getPollution()) 
    179154        return self 
     
    190165        spec.setPower(self.getPower() + otherSpec.getPower()) 
    191166        spec.setMaterial(self.getMaterial() + otherSpec.getMaterial()) 
    192         spec.setFood(self.getFood() + otherSpec.getFood()) 
    193167        spec.setPollution(self.getPollution() + otherSpec.getPollution()) 
    194168        return spec 
     
    207181        elif statID == 'material': 
    208182            return self.material 
    209         elif statID == 'food': 
    210             return self.food 
    211183        elif statID == 'pollution': 
    212184            return self.pollution 
     
    236208                                           self.power, 
    237209                                           self.material, 
    238                                            self.food, 
    239210                                           self.pollution) 
    240211        return output 
     
    250221            abs(otherSpec.power) <= self.power and \ 
    251222            abs(otherSpec.material) <= self.material and \ 
    252             abs(otherSpec.food) <= self.food and \ 
    253223            abs(otherSpec.pollution) <= self.pollution 
    254224 
     
    263233            self.power == otherSpec.power and \ 
    264234            self.material == otherSpec.material and \ 
    265             self.food == otherSpec.food and \ 
    266235            self.pollution == otherSpec.pollution 
    267236 
     
    285254            self.power <= otherSpec.power or \ 
    286255            self.material <= otherSpec.material or \ 
    287             self.food <= otherSpec.food or \ 
    288256            self.pollution <= otherSpec.pollution 
    289257 
     
    298266            self.power < otherSpec.power or \ 
    299267            self.material < otherSpec.material or \ 
    300             self.food < otherSpec.food or \ 
    301268            self.pollution < otherSpec.pollution 
    302269 
     
    311278            self.power > otherSpec.power or \ 
    312279            self.material > otherSpec.material or \ 
    313             self.food > otherSpec.food or \ 
    314280            self.pollution > otherSpec.pollution 
    315281 
    316282# defines the start spec 
    317 START_SPEC = Spec(START_MONEY, START_POWER, START_MATERIAL, 
    318                  START_FOOD, START_POLLUTION) 
     283START_SPEC = Spec(START_MONEY, START_POWER, START_MATERIAL, START_POLLUTION)