Class Tension

  • All Implemented Interfaces:
    Named

    public class Tension
    extends java.lang.Object
    implements Named
    A measure of the tension between nations.
    • Field Detail

      • TENSION_MAX

        public static final int TENSION_MAX
      • 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
      • WAR_MODIFIER

        public static final int WAR_MODIFIER
      • SURRENDERED

        public static final int SURRENDERED
        Tension level to set when surrendering.
      • value

        private int value
    • Constructor Detail

      • Tension

        public Tension()
        Create the default tension.
      • Tension

        public Tension​(int newTension)
        Create tension at a specified level.
        Parameters:
        newTension - The level of tension.
    • 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 interface Named
        Returns:
        The name of the Named.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

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