energyTycoon.customer
Class City

java.lang.Object
  extended by energyTycoon.customer.Customer
      extended by energyTycoon.customer.City

public class City
extends Customer


Constructor Summary
City(int id, Game game, java.lang.String name, int settingPrice, int developmentRate, double pop, int eco, int prosp)
           
 
Method Summary
 void compute(int time)
          Correspond to the method which compute all information each frame
 int computeEnergyNeed()
          Compute the total of city energy needed to make it works
 void computeFractionEnergy()
          Compute the fraction of energy that each supplier will have to provide according the satisfaction
 double computeLightEnergy()
          Compute The LightEnergy Needed by the population
 void computeNewPopulation()
           
 void computeNewSettingPrice()
          Compute the evolution of the setting price according the number of supplier
 double computeOtherEnergy()
          Compute The otherEnergy (like production of warm, washingmachine...)
 void computeSatisfaction(int time)
          Compute the satisfaction of the supplier according various details
 City getCity()
           
 java.lang.String getDefineMessage()
          Define the customer in a network string
 double getDevelopmentRate()
           
 int getEcology()
           
 int getPopulation()
           
 int getProsperity()
           
 int getSettingPrice()
           
 boolean isCity()
           
 void setEcology(int eco)
           
 void setPanel(CityPanel p)
           
 void setPopulation(double pop)
          Set the value of population
 void setProperity(int prosp)
           
 void update(double population, int ecology, int prosperity, int developmentRate, int settingPrice)
           
 
Methods inherited from class energyTycoon.customer.Customer
addProvider, getId, getIndustry, getName, isIndustry, setName, setSettingPrice
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

City

public City(int id,
            Game game,
            java.lang.String name,
            int settingPrice,
            int developmentRate,
            double pop,
            int eco,
            int prosp)
Parameters:
id -
game -
name -
settingPrice -
developmentRate -
pop -
eco -
prosp -
Method Detail

setPopulation

public void setPopulation(double pop)
Set the value of population

Parameters:
pop -

setEcology

public void setEcology(int eco)

setProperity

public void setProperity(int prosp)

getPopulation

public int getPopulation()

getDevelopmentRate

public double getDevelopmentRate()

getEcology

public int getEcology()

getProsperity

public int getProsperity()

getSettingPrice

public int getSettingPrice()

computeNewPopulation

public void computeNewPopulation()

computeNewSettingPrice

public void computeNewSettingPrice()
Compute the evolution of the setting price according the number of supplier


computeLightEnergy

public double computeLightEnergy()
Compute The LightEnergy Needed by the population

Returns:

computeOtherEnergy

public double computeOtherEnergy()
Compute The otherEnergy (like production of warm, washingmachine...) Needed by the population

Returns:

computeEnergyNeed

public int computeEnergyNeed()
Compute the total of city energy needed to make it works

Returns:

computeSatisfaction

public void computeSatisfaction(int time)
Compute the satisfaction of the supplier according various details

Parameters:
time -

computeFractionEnergy

public void computeFractionEnergy()
Compute the fraction of energy that each supplier will have to provide according the satisfaction


compute

public void compute(int time)
Correspond to the method which compute all information each frame

Specified by:
compute in class Customer
Parameters:
time -

getDefineMessage

public java.lang.String getDefineMessage()
Define the customer in a network string

Specified by:
getDefineMessage in class Customer
Returns:
network customer definition

isCity

public boolean isCity()
Overrides:
isCity in class Customer

getCity

public City getCity()
Overrides:
getCity in class Customer

update

public void update(double population,
                   int ecology,
                   int prosperity,
                   int developmentRate,
                   int settingPrice)
Parameters:
population -
ecology -
prosperity -
developmentRate -
settingPrice -

setPanel

public void setPanel(CityPanel p)