game.government.administration
Class AbstractAdministration

java.lang.Object
  |
  +--game.government.administration.AbstractAdministration
All Implemented Interfaces:
Administration
Direct Known Subclasses:
AreaAdministrationClass, SquareAdministrationClass

public abstract class AbstractAdministration
extends java.lang.Object
implements Administration

Abstract class to implement superior and economy in administration.


Field Summary
protected  float taxRate
          Tax rate for economy that this administration runs.
protected  boolean taxRateSet
          Used to determine if we should look to a higher administration level to find the appropriate tax rate.
 
Constructor Summary
AbstractAdministration()
          Constructor.
 
Method Summary
 void addEthnicPopulation(Ethnicity ethnicity, float population)
          Add an ethnic population to an ethnic group.
 Square getCapital()
          Get the administrative capital square, identical to getSquare().
 Civilization getCivilization()
          Get the civilization.
 Economy getEconomy()
          Get the Economy associated with the GovtEntity
 float getEthnicDiscrimination(Ethnicity ethnicity)
          Return the ethnic discrimination for this ethnicity.
 Government getGovernment()
          Get the government.
 GovtEconOrders getGovtEconOrders()
          get economic orders to apply to this admin's economy
 float getIsolation()
          Return the isolation factor for this administration.
 java.lang.String getName()
          Return the name of this instance.
 Square getPort()
          Get the administrative main port.
 float getReligionEffect()
          Return the religion effect for this administration.
 float getReligiousDiscrimination(Religion religion)
          Return the religious discrimination for this ethnicity.
 Square getSquare()
          Get the administrative capital square, identical to getCapital().
 AreaAdministration getSuperior()
          Get superior.
 float getTaxRate()
          getter for tax rate for this admin.
 boolean isGovernment()
          Whether this administration is the government.
 void setEconomy(Economy value)
          Set the economy.
 void setName(java.lang.String value)
          Set the name of this instance.
 void setPort(Square value)
          Set the administrative main port.
 void setSquare(Square value)
          Set the administrative capital square, identical to setCapital().
 void setSuperior(AreaAdministration value)
          Set the superior administration.
 void setTaxRate(float r)
          Tax rate for this economy.
 void setupEthnicPopulations()
          Compile all ethnic groups.
 void updateGovernmentPolicies(java.util.Map blockMap)
          Method calculates a fresh version of GovernmentPolicies and averages them to the parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface game.interfaces.Administration
economicsTurn, getNumberOfSquares, getPopulation, iterator, removeRecruits, size, squareIterator
 

Field Detail

taxRate

protected float taxRate
Tax rate for economy that this administration runs.


taxRateSet

protected boolean taxRateSet
Used to determine if we should look to a higher administration level to find the appropriate tax rate. if false look above

Constructor Detail

AbstractAdministration

public AbstractAdministration()
Constructor.

Method Detail

getCivilization

public Civilization getCivilization()
Get the civilization.

Specified by:
getCivilization in interface Administration
Returns:
the owning civilization.

getGovernment

public Government getGovernment()
Get the government.

Specified by:
getGovernment in interface Administration
Returns:
the owning government.

isGovernment

public boolean isGovernment()
Whether this administration is the government.

Specified by:
isGovernment in interface Administration

setName

public void setName(java.lang.String value)
Set the name of this instance.

Specified by:
setName in interface Administration
Parameters:
value - the name to set.

getName

public java.lang.String getName()
Return the name of this instance.

Specified by:
getName in interface Administration
Returns:
the name.

getCapital

public Square getCapital()
Get the administrative capital square, identical to getSquare().

Specified by:
getCapital in interface Administration

getSquare

public Square getSquare()
Get the administrative capital square, identical to getCapital().

Specified by:
getSquare in interface Administration

setSquare

public void setSquare(Square value)
Set the administrative capital square, identical to setCapital().

Specified by:
setSquare in interface Administration

getPort

public Square getPort()
Get the administrative main port.

Specified by:
getPort in interface Administration

setPort

public void setPort(Square value)
Set the administrative main port.

Specified by:
setPort in interface Administration

getSuperior

public AreaAdministration getSuperior()
Get superior.

Specified by:
getSuperior in interface Administration
Returns:
the superior administration.

setSuperior

public void setSuperior(AreaAdministration value)
Set the superior administration.

Specified by:
setSuperior in interface Administration
Parameters:
value - the new superior.

getIsolation

public float getIsolation()
Return the isolation factor for this administration.

Specified by:
getIsolation in interface Administration
Returns:
the isolation factor for this administration.

addEthnicPopulation

public void addEthnicPopulation(Ethnicity ethnicity,
                                float population)
Add an ethnic population to an ethnic group.

Specified by:
addEthnicPopulation in interface Administration

setupEthnicPopulations

public void setupEthnicPopulations()
Compile all ethnic groups.

Specified by:
setupEthnicPopulations in interface Administration

updateGovernmentPolicies

public void updateGovernmentPolicies(java.util.Map blockMap)
Method calculates a fresh version of GovernmentPolicies and averages them to the parameter.

Specified by:
updateGovernmentPolicies in interface Administration
Parameters:
blockMap - the map of policies averaged over previous ethnic groups.

getEthnicDiscrimination

public float getEthnicDiscrimination(Ethnicity ethnicity)
Return the ethnic discrimination for this ethnicity.

Specified by:
getEthnicDiscrimination in interface Administration
Returns:
the ethnic discrimination for this ethnicity.

getReligiousDiscrimination

public float getReligiousDiscrimination(Religion religion)
Return the religious discrimination for this ethnicity.

Specified by:
getReligiousDiscrimination in interface Administration
Returns:
the religious discrimination for this ethnicity.

getReligionEffect

public float getReligionEffect()
Return the religion effect for this administration.

Specified by:
getReligionEffect in interface Administration
Returns:
the religious effect for this administration.

getEconomy

public Economy getEconomy()
Get the Economy associated with the GovtEntity

Specified by:
getEconomy in interface Administration
Returns:
the name of this GovtEntity.

setEconomy

public void setEconomy(Economy value)
Set the economy.

Specified by:
setEconomy in interface Administration
Parameters:
value - the Economy interface to add.

getGovtEconOrders

public GovtEconOrders getGovtEconOrders()
get economic orders to apply to this admin's economy

Specified by:
getGovtEconOrders in interface Administration

getTaxRate

public float getTaxRate()
getter for tax rate for this admin. If tax rate is not set here method will go up the hierarchy to find appropriate tax rate.

Specified by:
getTaxRate in interface Administration
Returns:
tax rate

setTaxRate

public void setTaxRate(float r)
Tax rate for this economy. Value restricted to [0,1]

Specified by:
setTaxRate in interface Administration