Class EuropeWas


  • public class EuropeWas
    extends java.lang.Object
    Helper container to remember the Europe state prior to some change, and fire off any consequent property changes.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Europe europe
      The Europe to remember.
      private static java.util.logging.Logger logger  
      private int unitCount
      The initial number of units in the Europe.
    • Constructor Summary

      Constructors 
      Constructor Description
      EuropeWas​(Europe europe)
      Create a new wrapper to remember the state of Europe.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean fireChanges()
      Fire any property changes resulting from actions in Europe.
      Unit getNewUnit()
      Gets a unit added to Europe since this EuropeWas was sampled.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • logger

        private static final java.util.logging.Logger logger
      • europe

        private final Europe europe
        The Europe to remember.
      • unitCount

        private final int unitCount
        The initial number of units in the Europe.
    • Constructor Detail

      • EuropeWas

        public EuropeWas​(Europe europe)
        Create a new wrapper to remember the state of Europe.
        Parameters:
        europe - The Europe to remember.
    • Method Detail

      • getNewUnit

        public Unit getNewUnit()
        Gets a unit added to Europe since this EuropeWas was sampled. As long there is at least one new unit, pick the one with the highest numeric id.
        Returns:
        The newest Unit or null if none has been added.
      • fireChanges

        public boolean fireChanges()
        Fire any property changes resulting from actions in Europe.
        Returns:
        True if something changed.