Class ChangeSet.RemoveChange

  • Enclosing class:
    ChangeSet

    private static class ChangeSet.RemoveChange
    extends ChangeSet.Change<RemoveMessage>
    Encapsulates removing some objects. -vis: If removing settlements or units, visibility changes.
    • Field Detail

      • tile

        private final Tile tile
    • Constructor Detail

      • RemoveChange

        public RemoveChange​(ChangeSet.See see,
                            Location loc,
                            java.util.stream.Stream<? extends FreeColGameObject> objects)
        Build a new RemoveChange for an object that is disposed.
        Parameters:
        see - The visibility of this change.
        loc - The Location where the object was.
        objects - The FreeColGameObjects to remove.
    • Method Detail

      • getMainObject

        private FreeColGameObject getMainObject()
        By convention, the main object is last. All other objects are internal to it and should be removed first if visible.
        Returns:
        The main object.
      • fullRemoval

        private boolean fullRemoval​(Player player)
        Should we tell a player to remove all the objects or just the main one?
        Parameters:
        player - A Player to check.
        Returns:
        True if all the objects must go.
      • isNotifiable

        public boolean isNotifiable​(Player player)
        Should a player be notified of this Change? Override in subclasses with special cases.
        Overrides:
        isNotifiable in class ChangeSet.Change<RemoveMessage>
        Parameters:
        player - The Player to consider.
        Returns:
        True if this Change should be sent.
      • toString

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