net.sf.freecol.common.model
Class Tension

java.lang.Object
  extended by net.sf.freecol.common.model.Tension

public class Tension
extends java.lang.Object


Nested Class Summary
static class Tension.Level
          Constants for describing alarm levels.
 
Field Summary
static int ALLIANCE_MODIFIER
          Tension modification to be used when an alliance treaty is signed.
static int CEASE_FIRE_MODIFIER
          Tension modification to be used when a cease-fire treaty is signed.
static int PEACE_TREATY_MODIFIER
          Tension modification to be used when a peace treaty is signed.
static int TENSION_ADD_CAPITAL_ATTACKED
           
static int TENSION_ADD_DECLARE_WAR_FROM_CEASE_FIRE
          Tension modification to be used when war is declared from a cease fire.
static int TENSION_ADD_DECLARE_WAR_FROM_PEACE
          Tension modification to be used when war is declared from a peaceful state.
static int TENSION_ADD_LAND_TAKEN
           
static int TENSION_ADD_MAJOR
           
static int TENSION_ADD_MINOR
          Constants for adding to the tension levels.
static int TENSION_ADD_NORMAL
           
static int TENSION_ADD_SETTLEMENT_ATTACKED
           
static int TENSION_ADD_UNIT_DESTROYED
           
 
Constructor Summary
Tension()
          Constructor.
Tension(int newTension)
           
 
Method Summary
 Tension.Level getLevel()
          Returns the current tension level.
 int getValue()
          Returns the current tension value.
 void modify(int newTension)
          Modifies the tension by the given amount.
 void setLevel(Tension.Level level)
           
 void setValue(int newValue)
          Sets the current tension value.
 java.lang.String toString()
          Returns the current tension level as a string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TENSION_ADD_MINOR

public static final int TENSION_ADD_MINOR
Constants for adding to the tension levels.

See Also:
Constant Field Values

TENSION_ADD_NORMAL

public static final int TENSION_ADD_NORMAL
See Also:
Constant Field Values

TENSION_ADD_MAJOR

public static final int TENSION_ADD_MAJOR
See Also:
Constant Field Values

TENSION_ADD_LAND_TAKEN

public static final int TENSION_ADD_LAND_TAKEN
See Also:
Constant Field Values

TENSION_ADD_UNIT_DESTROYED

public static final int TENSION_ADD_UNIT_DESTROYED
See Also:
Constant Field Values

TENSION_ADD_SETTLEMENT_ATTACKED

public static final int TENSION_ADD_SETTLEMENT_ATTACKED
See Also:
Constant Field Values

TENSION_ADD_CAPITAL_ATTACKED

public static final int TENSION_ADD_CAPITAL_ATTACKED
See Also:
Constant Field Values

TENSION_ADD_DECLARE_WAR_FROM_PEACE

public static final int TENSION_ADD_DECLARE_WAR_FROM_PEACE
Tension modification to be used when war is declared from a peaceful state.

See Also:
Constant Field Values

TENSION_ADD_DECLARE_WAR_FROM_CEASE_FIRE

public static final int TENSION_ADD_DECLARE_WAR_FROM_CEASE_FIRE
Tension modification to be used when war is declared from a cease fire.

See Also:
Constant Field Values

PEACE_TREATY_MODIFIER

public static final int PEACE_TREATY_MODIFIER
Tension modification to be used when a peace treaty is signed.

See Also:
Constant Field Values

CEASE_FIRE_MODIFIER

public static final int CEASE_FIRE_MODIFIER
Tension modification to be used when a cease-fire treaty is signed.

See Also:
Constant Field Values

ALLIANCE_MODIFIER

public static final int ALLIANCE_MODIFIER
Tension modification to be used when an alliance treaty is signed.

See Also:
Constant Field Values
Constructor Detail

Tension

public Tension()
Constructor.


Tension

public Tension(int newTension)
Method Detail

getValue

public int getValue()
Returns the current tension value.

Returns:
The value of this Tension.

setValue

public void setValue(int newValue)
Sets the current tension value.

Parameters:
newValue - The new value of the tension.

getLevel

public Tension.Level getLevel()
Returns the current tension level.

Returns:
The current level.

setLevel

public void setLevel(Tension.Level level)

modify

public void modify(int newTension)
Modifies the tension by the given amount.

Parameters:
newTension - The amount to modify tension by.

toString

public java.lang.String toString()
Returns the current tension level as a string.

Overrides:
toString in class java.lang.Object
Returns:
A String-representation of the current tension level.