energyTycoon.player
Class FullPlayer

java.lang.Object
  extended by energyTycoon.player.Player
      extended by energyTycoon.player.FullPlayer
Direct Known Subclasses:
NetworkServerPlayer, PhysicPlayer

public abstract class FullPlayer
extends Player

Manage a complete player

Author:
Leo CARNAUT-DELORD

Constructor Summary
FullPlayer()
          pro customer number this frame
 
Method Summary
 void addPowerStationGeneration(int groupId)
          add a power station generation
 void addPowerStationGroup(PowerStationGroup psg, int generation)
          add a group to available station for the player
 void askChangeClientPrice(Customer cust, int price)
           
 void build(PowerStationType building)
           
 void changeExchangeMinAndMax(int min, int max)
          change minimum and maximum energy stock
 void changeMoney()
           
 void citySetting(City city)
           
abstract  void delete()
           
 void deletePowerStation(int powerStationId)
          delete the power station
 void deletePowerStationsInRemoveList()
          delete all power stations in delete list
 void deleteStation(int powerStationId, int pollution, java.lang.String message)
          destroy the given central
 void eraseBuilding(PowerStation station)
           
 void explodeStation(int powerStationId, int pollution, java.lang.String message)
          explode the given central
 java.util.List<PowerStationGroup> getAllAvailablePowerStationGroup()
          get all group available for this player
 java.util.List<PowerStationType> getAllAvailablePowerStationType(int groupId)
          Get all power station from groupId that the player can build
 Battery getBattery()
          return the player battery
 int getGroupMaxGenerationAvailable(int powerStationGroupId)
           
 int getMaximumStock()
          get maximum stock, sell if we have more
 int getMinimumStock()
          get minimum stock, buy if less
 int getMoney()
           
 int getNbPowerStationByType(PowerStationType pst)
          Get the number of power stations of this type owned by the player
 PowerStation getPowerStation(int powerStationId)
          get the power station of the given id
 int getResearchKnownEnergyBudget()
          get research budget
 int getResearchNewEnergyBudget()
          get research budget
 int getTotalPollution()
           
 void newMessage(java.lang.String Message)
          send information to player
 void quitCity(City city)
           
 void setMaximumStock(int qt)
           
 void setMinimumStock(int qt)
           
 void setMoney(int money)
          set player money
 void setResearchBudget(int newBudget, int knowingBudget)
          change research budget
 
Methods inherited from class energyTycoon.player.Player
getEcology, getId, getName, setEcology
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FullPlayer

public FullPlayer()
pro customer number this frame

Method Detail

build

public void build(PowerStationType building)

getMoney

public int getMoney()

changeMoney

public void changeMoney()

getNbPowerStationByType

public int getNbPowerStationByType(PowerStationType pst)
Get the number of power stations of this type owned by the player

Parameters:
pst -
Returns:
power station number

setResearchBudget

public void setResearchBudget(int newBudget,
                              int knowingBudget)
change research budget

Parameters:
newBudget -
knowingBudget -

setMoney

public void setMoney(int money)
set player money

Parameters:
money -

eraseBuilding

public void eraseBuilding(PowerStation station)

getTotalPollution

public int getTotalPollution()

citySetting

public void citySetting(City city)

quitCity

public void quitCity(City city)

setMinimumStock

public void setMinimumStock(int qt)

setMaximumStock

public void setMaximumStock(int qt)

getResearchNewEnergyBudget

public int getResearchNewEnergyBudget()
get research budget

Returns:
research budget for new energy

getResearchKnownEnergyBudget

public int getResearchKnownEnergyBudget()
get research budget

Returns:
research budget for new generation power station

askChangeClientPrice

public void askChangeClientPrice(Customer cust,
                                 int price)

newMessage

public void newMessage(java.lang.String Message)
send information to player

Parameters:
Message - the message to send

deleteStation

public void deleteStation(int powerStationId,
                          int pollution,
                          java.lang.String message)
destroy the given central

Parameters:
powerStationId -
pollution -
message -

explodeStation

public void explodeStation(int powerStationId,
                           int pollution,
                           java.lang.String message)
explode the given central

Parameters:
powerStationId -
pollution -
message -

delete

public abstract void delete()
Specified by:
delete in class Player

addPowerStationGroup

public void addPowerStationGroup(PowerStationGroup psg,
                                 int generation)
add a group to available station for the player

Parameters:
psg - the power station group
generation - the maximum power station available

addPowerStationGeneration

public void addPowerStationGeneration(int groupId)
add a power station generation

Parameters:
groupId -

getAllAvailablePowerStationType

public java.util.List<PowerStationType> getAllAvailablePowerStationType(int groupId)
Get all power station from groupId that the player can build

Parameters:
groupId -
Returns:
the power station type list

getMinimumStock

public int getMinimumStock()
get minimum stock, buy if less

Returns:
minimum stock

getMaximumStock

public int getMaximumStock()
get maximum stock, sell if we have more

Returns:
maximum stock

getAllAvailablePowerStationGroup

public java.util.List<PowerStationGroup> getAllAvailablePowerStationGroup()
get all group available for this player

Returns:
power station group list

changeExchangeMinAndMax

public void changeExchangeMinAndMax(int min,
                                    int max)
change minimum and maximum energy stock

Parameters:
min -
max -

getBattery

public Battery getBattery()
return the player battery

Returns:

deletePowerStation

public void deletePowerStation(int powerStationId)
delete the power station

Parameters:
powerStationId -

deletePowerStationsInRemoveList

public void deletePowerStationsInRemoveList()
delete all power stations in delete list


getPowerStation

public PowerStation getPowerStation(int powerStationId)
get the power station of the given id

Parameters:
powerStationId -
Returns:
power station of the given id

getGroupMaxGenerationAvailable

public int getGroupMaxGenerationAvailable(int powerStationGroupId)