Package net.sf.freecol.common.model
Class Tension
- java.lang.Object
-
- net.sf.freecol.common.model.Tension
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Tension.Level
Constants for describing alarm levels.
-
Field Summary
Fields Modifier and Type Field Description static int
ALLIANCE_MODIFIER
static int
CEASE_FIRE_MODIFIER
static int
CONTACT_MODIFIER
static int
DELTA
static int
DROP_ALLIANCE_MODIFIER
static int
PEACE_TREATY_MODIFIER
static int
RESUME_WAR_MODIFIER
static int
SURRENDERED
Tension level to set when surrendering.static int
TENSION_ADD_CAPITAL_ATTACKED
static int
TENSION_ADD_LAND_TAKEN
static int
TENSION_ADD_MAJOR
static int
TENSION_ADD_MINOR
static int
TENSION_ADD_NORMAL
static int
TENSION_ADD_SETTLEMENT_ATTACKED
static int
TENSION_ADD_UNIT_DESTROYED
static int
TENSION_ADD_WAR_INCITER
static int
TENSION_MAX
static int
TENSION_MIN
private int
value
static int
WAR_MODIFIER
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
java.lang.String
getKey()
Get the stem key.Tension.Level
getLevel()
Get the current tension level.java.lang.String
getNameKey()
Gets the name of this named object.int
getValue()
Get the current tension value.int
hashCode()
void
modify(int newTension)
Modify the tension by the given amount.void
setValue(int newValue)
Sets the current tension value.java.lang.String
toString()
-
-
-
Field Detail
-
TENSION_MIN
public static final int TENSION_MIN
- See Also:
- Constant Field Values
-
TENSION_MAX
public static final int TENSION_MAX
-
DELTA
public static final int DELTA
- See Also:
- Constant Field Values
-
TENSION_ADD_MINOR
public static final int TENSION_ADD_MINOR
- 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_WAR_INCITER
public static final int TENSION_ADD_WAR_INCITER
- See Also:
- Constant Field Values
-
CONTACT_MODIFIER
public static final int CONTACT_MODIFIER
- See Also:
- Constant Field Values
-
ALLIANCE_MODIFIER
public static final int ALLIANCE_MODIFIER
- See Also:
- Constant Field Values
-
DROP_ALLIANCE_MODIFIER
public static final int DROP_ALLIANCE_MODIFIER
- See Also:
- Constant Field Values
-
PEACE_TREATY_MODIFIER
public static final int PEACE_TREATY_MODIFIER
- See Also:
- Constant Field Values
-
CEASE_FIRE_MODIFIER
public static final int CEASE_FIRE_MODIFIER
- See Also:
- Constant Field Values
-
WAR_MODIFIER
public static final int WAR_MODIFIER
-
RESUME_WAR_MODIFIER
public static final int RESUME_WAR_MODIFIER
- See Also:
- Constant Field Values
-
SURRENDERED
public static final int SURRENDERED
Tension level to set when surrendering.
-
value
private int value
-
-
Method Detail
-
getValue
public final int getValue()
Get the current tension value.- Returns:
- The value of this
Tension
.
-
setValue
public final void setValue(int newValue)
Sets the current tension value.- Parameters:
newValue
- The new value of the tension.
-
getLevel
public final Tension.Level getLevel()
Get the current tension level.- Returns:
- The current level.
-
modify
public final void modify(int newTension)
Modify the tension by the given amount.- Parameters:
newTension
- The amount to modify tension by.
-
getKey
public java.lang.String getKey()
Get the stem key.- Returns:
- The tension stem key.
-
getNameKey
public java.lang.String getNameKey()
Gets the name of this named object. Try to avoid using this directly except in i18n-related routines or to implement itself in more complext objects.- Specified by:
getNameKey
in interfaceNamed
- Returns:
- The name of the
Named
.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-