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, FullPlayer player)
           
Battery(ServerGame server, FullPlayer player)
           
 
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()
           
 void computeRenovationPrice()
           
 int getCapacity()
           
 int getFromStock(int quantity)
          take back some energy on the battery
 int getLife()
          get the restant life of the plant : 100 to 0...
 int getMaintenancePrice()
          get maintenance price for the month
 java.lang.String getNetworkDefinition()
           
 int getStock()
           
 void setCapacity(int capa)
          Change capacity
 void setLastRenovationDate(int date)
           
 void setMaintenancePrice(int price)
           
 void setStock(int stock)
          change stock
 
Methods inherited from class energyTycoon.powerStation.EnergyProviderBuilding
askRestore, askUpdate, computeMonthlyUsePrice, explode, getConstructionDate, getGeneration, getId, getLastRenovationDate, getLifeTime, getMonthlyUsePrice, getPowerStationType, getRenovationPrice, restore, setClient, setPowerStationType, setServer
 
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,
               FullPlayer player)

Battery

public Battery(ClientGame client,
               FullPlayer player)
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()

computeRenovationPrice

public void computeRenovationPrice()

setMaintenancePrice

public void setMaintenancePrice(int price)

setLastRenovationDate

public void setLastRenovationDate(int date)

getNetworkDefinition

public java.lang.String getNetworkDefinition()
Returns:

setStock

public void setStock(int stock)
change stock

Parameters:
stock -

setCapacity

public void setCapacity(int capa)
Change capacity

Parameters:
capa -

getLife

public int getLife()
Description copied from class: EnergyProviderBuilding
get the restant life of the plant : 100 to 0...

Overrides:
getLife in class EnergyProviderBuilding
Returns: