new building: energy accumulator for energy storage
[browser-rts.git] / src / repository / city.ts
index 1094f10cff35e9ee13f205eea58ba82ffa4a5dff..6e08ff8ae8c6af3301605b0a722ae2c4b53aa2ff 100644 (file)
@@ -30,6 +30,7 @@ export type City = {
     farms: number;
     warehouses: number;
     solar_panels: number;
+    accumulators: number;
     barracks: number;
     special_attacker_trainer: number;
     special_defender_trainer: number;
@@ -79,6 +80,7 @@ export class CityRepository extends Repository<City> {
             farms: 5,
             warehouses: 5,
             solar_panels: 5,
+            accumulators: 5,
             barracks: 0,
             special_attacker_trainer: 0,
             special_defender_trainer: 0,
@@ -332,6 +334,10 @@ where l.sector_id = ?`, [sector_id]);
       return city.warehouses * 250;
     }
 
+    maxEnergy(city: City): number {
+      return city.accumulators * 150;
+    }
+
     async foodProductionPerTick(city: City): Promise<number> {
       // eventually we should supply the warehouse formula 
       // to calculate the max amount of food created per tick