energyTycoon.powerStation
Class Battery

java.lang.Object
  extended by energyTycoon.powerStation.EnergyProviderBuilding
      extended by energyTycoon.powerStation.Battery

public class Battery
extends EnergyProviderBuilding


Field Summary
static int CELL_CAPACITY
           
 
Constructor Summary
Battery(ClientGame client, int stationId, FullPlayer player, PowerStationType powerStationType)
           
Battery(ServerGame server, int stationId, FullPlayer player, PowerStationType powerStationType)
           
 
Method Summary
 void addCapacity(int nbCells)
          Ajout de la capacité des batteries en fonction du nombre de cellules achetées
 int addToStock(int quantity)
          save some energy on battery
 void compute(int time)
          compute the battery (loose energy, explode, ...)
 void computeMaintenancePrice()
           
 int getCapacity()
           
 int getFromStock(int quantity)
          take back some energy on the battery
 int getMaintenancePrice()
          get maintenance price for the month
 int getStock()
           
 
Methods inherited from class energyTycoon.powerStation.EnergyProviderBuilding
askRestore, askUpdate, deleteStation, getConstructionDate, getGeneration, getId, getLastRenovationDate, getLifeTime, restore, setClient, setServer, update
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CELL_CAPACITY

public static final int CELL_CAPACITY
See Also:
Constant Field Values
Constructor Detail

Battery

public Battery(ServerGame server,
               int stationId,
               FullPlayer player,
               PowerStationType powerStationType)

Battery

public Battery(ClientGame client,
               int stationId,
               FullPlayer player,
               PowerStationType powerStationType)
Method Detail

getCapacity

public int getCapacity()

getStock

public int getStock()

addToStock

public int addToStock(int quantity)
save some energy on battery

Parameters:
quantity - quantity of energy to stock
Returns:
quantity of energy saved

getFromStock

public int getFromStock(int quantity)
take back some energy on the battery

Parameters:
quantity - quantity to get from stock
Returns:
real quantity get

addCapacity

public void addCapacity(int nbCells)
Ajout de la capacité des batteries en fonction du nombre de cellules achetées

Parameters:
nbCells - : cells number in your battery

compute

public void compute(int time)
compute the battery (loose energy, explode, ...)

Parameters:
time - time in second

getMaintenancePrice

public int getMaintenancePrice()
Description copied from class: EnergyProviderBuilding
get maintenance price for the month

Specified by:
getMaintenancePrice in class EnergyProviderBuilding
Returns:
exploitation price

computeMaintenancePrice

public void computeMaintenancePrice()