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 classTension.LevelConstants for describing alarm levels.
-
Field Summary
Fields Modifier and Type Field Description static intALLIANCE_MODIFIERstatic intCEASE_FIRE_MODIFIERstatic intCONTACT_MODIFIERstatic intDELTAstatic intDROP_ALLIANCE_MODIFIERstatic intPEACE_TREATY_MODIFIERstatic intRESUME_WAR_MODIFIERstatic intSURRENDEREDTension level to set when surrendering.static intTENSION_ADD_CAPITAL_ATTACKEDstatic intTENSION_ADD_LAND_TAKENstatic intTENSION_ADD_MAJORstatic intTENSION_ADD_MINORstatic intTENSION_ADD_NORMALstatic intTENSION_ADD_SETTLEMENT_ATTACKEDstatic intTENSION_ADD_UNIT_DESTROYEDstatic intTENSION_ADD_WAR_INCITERstatic intTENSION_MAXstatic intTENSION_MINprivate intvaluestatic intWAR_MODIFIER
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.lang.StringgetKey()Get the stem key.Tension.LevelgetLevel()Get the current tension level.java.lang.StringgetNameKey()Gets the name of this named object.intgetValue()Get the current tension value.inthashCode()voidmodify(int newTension)Modify the tension by the given amount.voidsetValue(int newValue)Sets the current tension value.java.lang.StringtoString()
-
-
-
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:
getNameKeyin interfaceNamed- Returns:
- The name of the
Named.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-