game.government
Class CivilizationClass

java.lang.Object
  |
  +--game.government.CivilizationClass
All Implemented Interfaces:
Civilization, Selectable

public class CivilizationClass
extends java.lang.Object
implements Civilization

The class which represents a cvilization.


Constructor Summary
CivilizationClass()
          Constructor.
CivilizationClass(NamedObject value)
          Constructor.
 
Method Summary
 void addCondition(Condition value)
          Add a condition.
 void economicsTurn()
          Perform one turn's worth of economics.
 Civilization findEnemy()
          Find an enemy civilization.
 java.lang.String getAdjective()
          Get the adjective for the civilization.
 AI getAI()
          Return the AI.
 Attitude getAttitude(Civilization civ)
          Get attitude of another civilization.
 Square getCapital()
          Return the location of the capital.
 CivEconomy getCivEconomy()
           
 java.awt.Color getColor()
          Return the civilization's color.
 java.lang.String getDefeatMessage()
          Gets the defeat message.
 java.lang.String getDescription()
          Get the description for the civilization.
 float getDispersal()
          Get dispersal.
 Government getGovernment()
          Get the government.
 HighCommand getHighCommand()
          Get the high command.
 java.lang.String getName()
          Get the name of the civilization.
 float getRecruitment()
          Get recruitment.
 Technologies getTechnologies()
          Get the technology interface for this civilization.
 Victory getVictory()
          Gets the victory conditions.
 java.lang.String getVictoryMessage()
          Gets the victory message.
static XML getXML()
           
 boolean hasCondition(Condition value)
          Whether the civilization has the condition.
 boolean isAlive()
          Is this civilization alive?
 boolean isEnemy(Civilization otherCiv)
          Check to see if this civilization regards another civilization as an enemy.
 boolean isSelectable()
          Is this object selectable?
 void remove()
          Tidy up when this civilization is no more.
 void selectStartingSquare()
          Set the starting square to be the selected square.
 void setAdjective(java.lang.String value)
          Set the adjective for the civilization.
 void setAttitude(Civilization civ, Attitude attitude)
          Set attitude of another civilization.
 void setCity(City city)
          Set a city.
 void setColor(java.awt.Color value)
          Set the civilization's color by color.
 void setColor(java.lang.String value)
          Set the civilization's color by name.
 void setDefeatMessage(java.lang.String value)
          Sets the defeat message.
 void setDescription(java.lang.String value)
          Set the description for the civilization.
 void setDispersal(float value)
          Set dispersal level.
 void setGovernment(Government value)
          Set government.
 void setHighCommand(HighCommandClass value)
          Set high command.
 void setName(NamedObject value)
          Set the name of the civilization.
 void setName(java.lang.String value)
          Set the name of the civilization.
 void setPlayerAI()
          Set the AI for the PLayer.
 void setPsychotic()
          Set the civilization to psychotic.
 void setRecruitment(float value)
          Set recruitment level.
 void setSelectable(boolean dummy)
          Set selectable state.
 void setStart(Location value)
          Set the starting square.
 void setStart(java.lang.String value)
          Set the starting square.
 void setVictory(Victory value)
          Sets the victory conditions.
 void setVictoryMessage(java.lang.String value)
          Sets the victory message.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CivilizationClass

public CivilizationClass()
Constructor.


CivilizationClass

public CivilizationClass(NamedObject value)
Constructor.

Method Detail

setPlayerAI

public void setPlayerAI()
Set the AI for the PLayer.

Specified by:
setPlayerAI in interface Civilization

getAI

public AI getAI()
Return the AI.

Specified by:
getAI in interface Civilization

setName

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

Parameters:
value - name to give the civilization.

setName

public void setName(NamedObject value)
Set the name of the civilization.

Parameters:
value - name to give the civilization.

getName

public java.lang.String getName()
Get the name of the civilization.

Specified by:
getName in interface Civilization
Returns:
the name of this civilization.

setAdjective

public void setAdjective(java.lang.String value)
Set the adjective for the civilization.

Parameters:
value - adjective that describes the civilization.

getAdjective

public java.lang.String getAdjective()
Get the adjective for the civilization.

Specified by:
getAdjective in interface Civilization
Returns:
the adjective describing this civilization.

setDescription

public void setDescription(java.lang.String value)
Set the description for the civilization.

Parameters:
value - description that describes the civilization.

getDescription

public java.lang.String getDescription()
Get the description for the civilization.

Specified by:
getDescription in interface Civilization
Returns:
the description describing this civilization.

setColor

public void setColor(java.lang.String value)
Set the civilization's color by name.

Parameters:
value - the name of the color.

setColor

public void setColor(java.awt.Color value)
Set the civilization's color by color.

Parameters:
value - the color.

getColor

public java.awt.Color getColor()
Return the civilization's color.

Specified by:
getColor in interface Civilization
Returns:
the civilization's color.

setCity

public void setCity(City city)
Set a city.

Specified by:
setCity in interface Civilization

setVictoryMessage

public void setVictoryMessage(java.lang.String value)
Sets the victory message.

Parameters:
value - the victory message.

getVictoryMessage

public java.lang.String getVictoryMessage()
Gets the victory message.

Specified by:
getVictoryMessage in interface Civilization
Returns:
the victory message.

setDefeatMessage

public void setDefeatMessage(java.lang.String value)
Sets the defeat message.

Parameters:
value - the defeat message.

getDefeatMessage

public java.lang.String getDefeatMessage()
Gets the defeat message.

Specified by:
getDefeatMessage in interface Civilization
Returns:
the defeat message.

setVictory

public void setVictory(Victory value)
Sets the victory conditions.

Parameters:
value - the victory conditions.

getVictory

public Victory getVictory()
Gets the victory conditions.

Specified by:
getVictory in interface Civilization
Returns:
the victory conditions.

setRecruitment

public void setRecruitment(float value)
Set recruitment level.

Specified by:
setRecruitment in interface Civilization
Parameters:
value - value to set.

getRecruitment

public float getRecruitment()
Get recruitment.

Specified by:
getRecruitment in interface Civilization
Returns:
proportion that can be recruited.

setDispersal

public void setDispersal(float value)
Set dispersal level.

Specified by:
setDispersal in interface Civilization
Parameters:
value - value to set.

getDispersal

public float getDispersal()
Get dispersal.

Specified by:
getDispersal in interface Civilization
Returns:
proportion that can be recruited.

setGovernment

public void setGovernment(Government value)
Set government.

Parameters:
value - the government.

getGovernment

public Government getGovernment()
Get the government.

Specified by:
getGovernment in interface Civilization
Returns:
the government.

setHighCommand

public void setHighCommand(HighCommandClass value)
Set high command.

Parameters:
value - the high command.

getHighCommand

public HighCommand getHighCommand()
Get the high command.

Specified by:
getHighCommand in interface Civilization
Returns:
the high command.

remove

public void remove()
Tidy up when this civilization is no more.


getTechnologies

public Technologies getTechnologies()
Get the technology interface for this civilization.

Specified by:
getTechnologies in interface Civilization
Returns:
the technology interface for this civilization.

setAttitude

public void setAttitude(Civilization civ,
                        Attitude attitude)
Set attitude of another civilization.

Specified by:
setAttitude in interface Civilization
Parameters:
civ - the other civilization.
attitude - the attitude this to the other civilization.

getAttitude

public Attitude getAttitude(Civilization civ)
Get attitude of another civilization.

Specified by:
getAttitude in interface Civilization
Parameters:
civ - the other civilization.
Returns:
the the attitude of this civilization to the other one.

isEnemy

public boolean isEnemy(Civilization otherCiv)
Check to see if this civilization regards another civilization as an enemy.

Specified by:
isEnemy in interface Civilization
Parameters:
otherCiv - the other civilization.
Returns:
true if the other civ is regarded as an enemy.

findEnemy

public Civilization findEnemy()
Find an enemy civilization.

Specified by:
findEnemy in interface Civilization
Returns:
an enemy civilization, or null if there is none.

setPsychotic

public void setPsychotic()
Set the civilization to psychotic.

Specified by:
setPsychotic in interface Civilization

addCondition

public void addCondition(Condition value)
Add a condition.

Specified by:
addCondition in interface Civilization
Parameters:
value - the condition to add.

hasCondition

public boolean hasCondition(Condition value)
Whether the civilization has the condition.

Specified by:
hasCondition in interface Civilization
Parameters:
value - the condition to test.

economicsTurn

public void economicsTurn()
Perform one turn's worth of economics.

Specified by:
economicsTurn in interface Civilization

getCapital

public Square getCapital()
Return the location of the capital.

Returns:
the location of the capital.

isAlive

public boolean isAlive()
Is this civilization alive?

Specified by:
isAlive in interface Civilization
Returns:
true if it is.

isSelectable

public boolean isSelectable()
Is this object selectable?

Specified by:
isSelectable in interface Selectable
Returns:
true if the object is selectable.

setSelectable

public void setSelectable(boolean dummy)
Set selectable state.

Specified by:
setSelectable in interface Selectable
Parameters:
dummy - not used.

setStart

public void setStart(Location value)
Set the starting square.

Parameters:
value - the starting square coordinates.

setStart

public void setStart(java.lang.String value)
Set the starting square.

Parameters:
value - the starting square coordinates.

selectStartingSquare

public void selectStartingSquare()
Set the starting square to be the selected square.

Specified by:
selectStartingSquare in interface Civilization

getCivEconomy

public CivEconomy getCivEconomy()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getXML

public static XML getXML()