Class Game

    • Field Detail

      • logger

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

        private static final java.util.Map<java.lang.Class<? extends FreeColObject>,​java.lang.Class<? extends FreeColObject>> serverClasses
        Map of all classes with corresponding server classes.
      • locationClasses

        private static final java.util.Map<java.lang.String,​java.lang.Class<? extends FreeColGameObject>> locationClasses
        Map of class name to class for the location classes, to speed up game loading.
      • specification

        private Specification specification
        The Specification this game uses.
      • nextId

        protected int nextId
        The next available identifier that can be given to a new FreeColGameObject.
      • uuid

        private java.util.UUID uuid
        Game UUID, persistent in savegame files
      • clientUserName

        private java.lang.String clientUserName
        The client player name, null in the server.
      • players

        protected final java.util.List<Player> players
        All the players in the game.
      • unknownEnemy

        private Player unknownEnemy
        A virtual player to use for enemy privateers.
      • map

        protected Map map
        The map of the New World.
      • nationOptions

        private NationOptions nationOptions
        The current nation options. Mainly used to see if a player nation is available.
      • currentPlayer

        protected Player currentPlayer
        The player whose turn it is.
      • turn

        private Turn turn
        The current turn.
      • spanishSuccession

        private boolean spanishSuccession
        Whether the War of Spanish Succession has already taken place.
      • initialActiveUnitId

        private java.lang.String initialActiveUnitId
        Initial active unit identifier.
      • freeColGameObjects

        protected final java.util.HashMap<java.lang.String,​java.lang.ref.WeakReference<FreeColGameObject>> freeColGameObjects
        References to all objects created in this game. Serialization is not needed directly as these must be completely within { players, unknownEnemy, map } which are directly serialized.
      • combatModel

        protected CombatModel combatModel
        The combat model this game uses. At the moment, the only combat model available is the SimpleCombatModel, which strives to implement the combat model of the original game. However, it is anticipated that other, more complex combat models will be implemented in future. As soon as that happens, we will also have to make the combat model selectable.
      • REMOVE_GC_THRESHOLD

        private static final int REMOVE_GC_THRESHOLD
        The number of removed FCGOs that should trigger a cache clean.
        See Also:
        Constant Field Values
      • removeCount

        private int removeCount
        The number of FCGOs removed since last cache clean.
      • freeColGameObjectListener

        protected FreeColGameObjectListener freeColGameObjectListener
        A FreeColGameObjectListener to watch the objects in the game. Usually this is the AIMain instance. FIXME: is this better done with a property change listener?
      • CLIENT_USER_NAME_TAG

        private static final java.lang.String CLIENT_USER_NAME_TAG
        See Also:
        Constant Field Values
      • CURRENT_PLAYER_TAG

        private static final java.lang.String CURRENT_PLAYER_TAG
        See Also:
        Constant Field Values
      • INITIAL_ACTIVE_UNIT_ID

        private static final java.lang.String INITIAL_ACTIVE_UNIT_ID
        See Also:
        Constant Field Values
      • SPANISH_SUCCESSION_TAG

        private static final java.lang.String SPANISH_SUCCESSION_TAG
        See Also:
        Constant Field Values
    • Constructor Detail

      • Game

        public Game()
        Root constructor for games. Game.newInstance uses this so it must be public.
      • Game

        protected Game​(Specification specification)
        Constructor used by the ServerGame constructor.
        Parameters:
        specification - The Specification for this game.
      • Game

        public Game​(Game game,
                    FreeColXMLReader xr)
             throws javax.xml.stream.XMLStreamException
        Creates a new Game instance from a stream.
        Parameters:
        game - A base Game (not used here, this is a very special case).
        xr - The FreeColXMLReader to read from.
        Throws:
        javax.xml.stream.XMLStreamException - if an error occurs
    • Method Detail

      • preGameUpdate

        public boolean preGameUpdate​(Game game)
        Special update handler for the pre-game update. When starting a new game the server sends an update that contains the game map. This must be synchronized so that the client does not race ahead and launch into the game before the update completes. We used to check integrity here, but 1) the server has already done that and 2) the unexplored Tiles have no type which makes a lot of integrity failures.
        Parameters:
        game - The update for this Game.
        Returns:
        True if the update succeeds.
      • newInstance

        public static <T extends FreeColObject> T newInstance​(Game game,
                                                              java.lang.Class<T> returnClass,
                                                              boolean server)
        Instantiate an uninitialized FreeColGameObject within a game.
        Type Parameters:
        T - The actual return type.
        Parameters:
        game - The Game to instantiate in.
        returnClass - The required FreeColObject class.
        server - Create a server object if possible.
        Returns:
        The new uninitialized object, or null on error.
      • getDifficultyOptionGroup

        public final OptionGroup getDifficultyOptionGroup()
        Get the difficulty level of this game.
        Returns:
        An OptionGroup containing the difficulty settings.
      • getGameOptions

        public OptionGroup getGameOptions()
        Gets the game options associated with this game.
        Returns:
        An OptionGroup containing the game options.
      • setGameOptions

        public void setGameOptions​(OptionGroup go)
        Sets the game options associated with this game.
        Parameters:
        go - An OptionGroup containing the game options.
      • getMapGeneratorOptions

        public OptionGroup getMapGeneratorOptions()
        Gets the map generator options associated with this game.
        Returns:
        An OptionGroup containing the map generator options.
      • setMapGeneratorOptions

        public void setMapGeneratorOptions​(OptionGroup mgo)
        Sets the map generator options associated with this game.
        Parameters:
        mgo - An OptionGroup containing the map generator options.
      • getNextId

        public int getNextId()
        Stub for routine only meaningful in the server.
        Returns:
        Nothing.
      • getFreeColGameObject

        public FreeColGameObject getFreeColGameObject​(java.lang.String id)
        Gets the FreeColGameObject with the given identifier.
        Parameters:
        id - The object identifier.
        Returns:
        The game object, or null if not found.
      • getFreeColGameObject

        public <T extends FreeColGameObject> T getFreeColGameObject​(java.lang.String id,
                                                                    java.lang.Class<T> returnClass)
        Gets the FreeColGameObject with the specified identifier and class.
        Type Parameters:
        T - The actual return type.
        Parameters:
        id - The object identifier.
        returnClass - The expected class of the object.
        Returns:
        The game object, or null if not found.
      • setFreeColGameObject

        public void setFreeColGameObject​(java.lang.String id,
                                         FreeColGameObject fcgo)
        Set the mapping between object identifier and object.
        Parameters:
        id - The object identifier.
        fcgo - The FreeColGameObject to add to this Game.
      • addFreeColGameObject

        public void addFreeColGameObject​(java.lang.String id,
                                         FreeColGameObject fcgo)
        Add a new FreeColGameObject with a given identifier.
        Parameters:
        id - The object identifier.
        fcgo - The FreeColGameObject to add to this Game.
      • removeFreeColGameObject

        public void removeFreeColGameObject​(java.lang.String id,
                                            java.lang.String reason)
        Removes the FreeColGameObject with the specified identifier.
        Parameters:
        id - The object identifier.
        reason - A reason to remove the object.
        Throws:
        java.lang.IllegalArgumentException - If the identifier is null or empty.
      • update

        public <T extends FreeColGameObject> T update​(T other,
                                                      boolean create)
        Update a FreeColGameObject from another.
        Type Parameters:
        T - The type of object to update.
        Parameters:
        other - The other object.
        create - If true, create the object if it is missing.
        Returns:
        The resulting object after update.
      • update

        private <T extends FreeColGameObject> T update​(T other,
                                                       java.lang.Class<T> returnClass,
                                                       boolean create)
        Update a FreeColGameObject from another, optionally allowing missing objects to be created.
        Type Parameters:
        T - The type of object to update.
        Parameters:
        other - The other object.
        returnClass - The expected class of the object.
        create - If true, create missing objects.
        Returns:
        The resulting object after update.
      • update

        public <T extends FreeColGameObject> java.util.List<T> update​(java.util.Collection<T> other,
                                                                      boolean create)
        Convenience wrapper to update several FreeColGameObjects.
        Type Parameters:
        T - The type of object to update.
        Parameters:
        other - The collection of objects to update.
        create - If true, create missing objects.
        Returns:
        The resulting list of updated objects.
      • updateRef

        public <T extends FreeColGameObject> T updateRef​(T other)
        Update a FreeColGameObject from a reference to it in an update.
        Type Parameters:
        T - The type of object to update.
        Parameters:
        other - The other object.
        Returns:
        The resulting object after update.
      • updateRef

        private <T extends FreeColGameObject> T updateRef​(T other,
                                                          java.lang.Class<T> returnClass)
        Update a FreeColGameObject from a reference to it in an update.
        Type Parameters:
        T - The type of object to update.
        Parameters:
        other - The other object.
        returnClass - The expected class of the object.
        Returns:
        The resulting object after update.
      • updateRef

        public <T extends FreeColGameObject> java.util.List<T> updateRef​(java.util.Collection<T> other)
        Update several FreeColGameObjects from a list of references to it in an update.
        Type Parameters:
        T - The type of object to update.
        Parameters:
        other - The other object.
        Returns:
        The resulting object after update.
      • updateLocationRef

        public Location updateLocationRef​(Location loc)
        Update a Location from a reference to it in an update.
        Parameters:
        loc - The Location.
        Returns:
        The resulting location after update.
      • findFreeColLocation

        public Location findFreeColLocation​(java.lang.String id)
        Convenience wrapper to find a location (which is an interface, precluding using the typed version of getFreeColGameObject()) by identifier. Use this routine when the object should already be present in the game.
        Parameters:
        id - The object identifier.
        Returns:
        The Location if any.
      • getFreeColGameObjectIterator

        private java.util.Iterator<FreeColGameObject> getFreeColGameObjectIterator()
        Gets an Iterator over every registered FreeColGameObject. This Iterator should be iterated once in a while since it cleans the FreeColGameObject cache. Very few routines call this any more, so there is a thresholded call in removeFreeColGameObject to ensure the cache is still cleaned. Reconsider this if the situation changes. Lock freeColGameObjects when using this.
        Returns:
        An Iterator containing every registered FreeColGameObject.
      • getFreeColGameObjectList

        public java.util.List<FreeColGameObject> getFreeColGameObjectList()
        Get a list of all the FreeColGameObjects.
        Returns:
        A suitable list.
      • getUUID

        public java.util.UUID getUUID()
        Gets the unique identifier for this game. A game UUID persists in save game files.
        Returns:
        The game UUID.
      • getPlayerList

        protected java.util.List<Player> getPlayerList​(java.util.function.Predicate<? super Player> predicate)
        Get players in the game.
        Parameters:
        predicate - A Predicate to select suitable players with.
        Returns:
        A list of Players.
      • getPlayers

        public java.util.stream.Stream<Player> getPlayers​(java.util.function.Predicate<? super Player> predicate)
        Get players in the game.
        Parameters:
        predicate - A Predicate to select suitable players with.
        Returns:
        The stream of Players.
      • getPlayer

        public Player getPlayer​(java.util.function.Predicate<? super Player> predicate)
        Get a particular player in the game by a predicate.
        Parameters:
        predicate - A Predicate to select suitable players with.
        Returns:
        The Player found or null if not present.
      • setPlayers

        private void setPlayers​(java.util.List<Player> players)
        Set the players in the game.
        Parameters:
        players - The new Players to add.
      • getPlayerAfter

        private Player getPlayerAfter​(Player beforePlayer)
        Gets the live player after the given player.
        Parameters:
        beforePlayer - The Player before the Player to be returned.
        Returns:
        The Player after the beforePlayer in the list which determines the order each player becomes the current player.
        See Also:
        getNextPlayer()
      • addPlayer

        public void addPlayer​(Player player)
        Adds the specified player to the game.
        Parameters:
        player - The Player to add.
      • removePlayer

        public boolean removePlayer​(Player player)
        Removes the specified player from the game. We do not really remove the full FCGO from the game, just from the active players list.
        Parameters:
        player - The Player to remove.
        Returns:
        True if the player was removed.
      • getFirstPlayer

        public Player getFirstPlayer()
        Get the first player in this game.
        Returns:
        The first player, or null if none present.
      • sortPlayers

        public void sortPlayers​(java.util.Comparator<Player> comparator)
        Sort the players list.
        Parameters:
        comparator - The Comparator to sort with.
      • getPlayerByName

        public Player getPlayerByName​(java.lang.String name)
        Gets a player specified by a name.
        Parameters:
        name - The name identifying the Player.
        Returns:
        The Player or null if none found.
      • getPlayerByNation

        public Player getPlayerByNation​(Nation nation)
        Get a Player identified by its nation.
        Parameters:
        nation - The Nation to search for.
        Returns:
        The Player of the given nation, or null if not found.
      • getPlayerByNationId

        public Player getPlayerByNationId​(java.lang.String nationId)
        Get a Player identified by its nation identifier.
        Parameters:
        nationId - The nation identifier to search for.
        Returns:
        The Player of the given nation, or null if not found.
      • getLivePlayerList

        public java.util.List<Player> getLivePlayerList​(Player... exclude)
        Get a list of the live players in the game, optionally excluding supplied ones.
        Parameters:
        exclude - The Players to exclude.
        Returns:
        A list of live Players, without the excluded ones.
      • getLivePlayers

        public java.util.stream.Stream<Player> getLivePlayers​(Player... exclude)
        Get a stream of the live players in the game, optionally excluding supplied ones.
        Parameters:
        exclude - The Players to exclude.
        Returns:
        A stream of live Players, without the excluded ones.
      • getLiveEuropeanPlayerList

        public java.util.List<Player> getLiveEuropeanPlayerList​(Player... exclude)
        Get a list of the live European players in this game.
        Parameters:
        exclude - Players to exclude.
        Returns:
        A list of live European Players in this game, without the excluded ones.
      • getLiveEuropeanPlayers

        public java.util.stream.Stream<Player> getLiveEuropeanPlayers​(Player... exclude)
        Get a stream of the live European players in this game.
        Parameters:
        exclude - Players to exclude.
        Returns:
        A stream of live European Players in this game, without the excluded ones.
      • getLiveNativePlayerList

        public java.util.List<Player> getLiveNativePlayerList​(Player... exclude)
        Get a list of the live native players in this game.
        Parameters:
        exclude - Players to exclude.
        Returns:
        A list of live native Players in this game.
      • getLiveNativePlayers

        public java.util.stream.Stream<Player> getLiveNativePlayers​(Player... exclude)
        Get a stream of the live native players in this game.
        Parameters:
        exclude - Players to exclude.
        Returns:
        A stream of live native Players in this game.
      • getNextPlayer

        public Player getNextPlayer()
        Gets the next current player.
        Returns:
        The Player whose turn follows the current player.
      • addPlayers

        public void addPlayers​(java.util.List<Player> players)
        Add a list of players to this game. Called from the pre and in-game controllers when players change. ATM we never remove players, even dead ones. Must tolerate player being both present and not present.
        Parameters:
        players - The list of players to add.
      • getUnknownEnemy

        public Player getUnknownEnemy()
        Gets the unknown enemy player, which is used for privateers.
        Returns:
        The unknown enemy Player.
      • setUnknownEnemy

        public void setUnknownEnemy​(Player player)
        Sets the unknown enemy player.
        Parameters:
        player - The Player to serve as the unknown enemy.
      • getClientUserName

        public java.lang.String getClientUserName()
        Get the client user name.
        Returns:
        The client user name.
      • isInClient

        public boolean isInClient()
        Are we executing in a client?
        Returns:
        True in a client.
      • isInServer

        public boolean isInServer()
        Are we executing in the server?
        Returns:
        True in the server.
      • getClientPlayer

        public Player getClientPlayer()
        Get the client player this thread is operating for. If in the server there will be none.
        Returns:
        The client Player.
      • isInRevengeMode

        public boolean isInRevengeMode()
        Is this game in revenge mode?
        Returns:
        True if an undead player is present.
      • getCurrentPlayer

        public Player getCurrentPlayer()
        Gets the current player.
        Returns:
        The current player.
      • setCurrentPlayer

        public void setCurrentPlayer​(Player newCurrentPlayer)
        Sets the current player.
        Parameters:
        newCurrentPlayer - The new current Player.
      • getMap

        public Map getMap()
        Gets the map that is being used in this game.
        Returns:
        The game Map.
      • setMap

        public Map setMap​(Map newMap)
        Sets the game map.
        Parameters:
        newMap - The new Map to use.
        Returns:
        The old Map.
      • changeMap

        public void changeMap​(Map newMap)
        Change the map in this game, fixing player destinations.
        Parameters:
        newMap - The new Map to use.
      • getNationOptions

        public final NationOptions getNationOptions()
        Get the current nation options.
        Returns:
        The current NationOptions.
      • setNationOptions

        public final void setNationOptions​(NationOptions newNationOptions)
        Set the current nation options. Public for the test suite.
        Parameters:
        newNationOptions - The new NationOptions value.
      • getVacantNation

        public Nation getVacantNation()
        Find an available (i.e. vacant) nation.
        Returns:
        A vacant Nation or null if none found.
      • getVacantNations

        public final java.util.List<Nation> getVacantNations()
        Get the currently available nations.
        Returns:
        A list of available Nations.
      • canAddNewPlayer

        public boolean canAddNewPlayer()
        Can a new player be added to this game?
        Returns:
        True if a new player can be added.
      • getTurn

        public Turn getTurn()
        Gets the current turn in this game.
        Returns:
        The current Turn.
      • setTurn

        public void setTurn​(Turn newTurn)
        Sets the current turn in this game.
        Parameters:
        newTurn - The new Turn to set.
      • getAge

        public int getAge()
        Get the age for the current turn.
        Returns:
        The age (0-2).
      • getCombatModel

        public final CombatModel getCombatModel()
        Get the combat model in this game.
        Returns:
        The CombatModel.
      • setCombatModel

        public final void setCombatModel​(CombatModel newCombatModel)
        Set the game combat model.
        Parameters:
        newCombatModel - The new CombatModel value.
      • getSpanishSuccession

        public final boolean getSpanishSuccession()
        Has the Spanish Succession event occured?
        Returns:
        True if the Spanish Succession has occurred.
      • setSpanishSuccession

        public final void setSpanishSuccession​(boolean spanishSuccession)
        Set the Spanish Succession value.
        Parameters:
        spanishSuccession - The new Spanish Succession value.
      • getInitialActiveUnitId

        public java.lang.String getInitialActiveUnitId()
        Get the identifier for the initial active unit.
        Returns:
        The active unit identifier, if any.
      • getInitialActiveUnit

        public Unit getInitialActiveUnit()
        Get the initial active unit.
        Returns:
        The initial active Unit or null if none.
      • setInitialActiveUnitId

        public void setInitialActiveUnitId​(java.lang.String initialActiveUnitId)
        Set the identifier for the initial active unit.
        Parameters:
        initialActiveUnitId - The identifier for the current active unit.
      • setFreeColGameObjectListener

        public void setFreeColGameObjectListener​(FreeColGameObjectListener fcgol)
        Sets the FreeColGameObjectListener attached to this game.
        Parameters:
        fcgol - The new FreeColGameObjectListener.
      • notifySetFreeColGameObject

        public void notifySetFreeColGameObject​(java.lang.String id,
                                               FreeColGameObject fcgo)
        Notify a listener (if any) of a new game object.
        Parameters:
        id - The object identifier.
        fcgo - The new FreeColGameObject.
      • notifyRemoveFreeColGameObject

        public void notifyRemoveFreeColGameObject​(java.lang.String id)
        Notify a listener (if any) of that a game object has gone.
        Parameters:
        id - The object identifier.
      • notifyOwnerChanged

        public void notifyOwnerChanged​(FreeColGameObject source,
                                       Player oldOwner,
                                       Player newOwner)
        Notify a listener (if any) of that a game object has changed owner.
        Parameters:
        source - The FreeColGameObject that changed owner.
        oldOwner - The old owning Player.
        newOwner - The new owning Player.
      • checkOwners

        public void checkOwners​(Ownable o,
                                Player oldOwner)
        Maintain the player containers for certain ownables. Mainly useful in the client, informing the player that it has gained or lost an ownable.
        Parameters:
        o - The Ownable that may have changed.
        oldOwner - The previous (possible unchanged) owning Player.
      • allPlayersReadyToLaunch

        public boolean allPlayersReadyToLaunch()
        Checks if all players are ready to launch.
        Returns:
        True if all players are ready to launch.
      • getAllColonies

        public java.util.stream.Stream<Colony> getAllColonies​(Player player)
        Get all the colonies in the game.
        Parameters:
        player - An optional Player to omit.
        Returns:
        A stream of all the Colonys in the game.
      • getAllColoniesList

        public java.util.List<Colony> getAllColoniesList​(Player player)
        Get a list of all the colonies in the game.
        Parameters:
        player - An optional Player to omit.
        Returns:
        A list of all the Colonys in the game.
      • getSettlementByName

        public Settlement getSettlementByName​(java.lang.String name)
        Finds a settlement by name.
        Parameters:
        name - The name of the Settlement.
        Returns:
        The Settlement found, or null if there is no known Settlement with the specified name (the settlement might not be visible to a client).
      • getMessageSource

        public FreeColGameObject getMessageSource​(ModelMessage message)
        Helper function to get the source object of a message in this game.
        Parameters:
        message - The ModelMessage to find the object in.
        Returns:
        The source object.
      • getMessageDisplay

        public FreeColObject getMessageDisplay​(ModelMessage message)
        Helper function to get the object to display with a message in this game.
        Parameters:
        message - The ModelMessage to find the object in.
        Returns:
        An object to display.
      • getStatistics

        public java.util.Map<java.lang.String,​java.lang.String> getStatistics()
        Gets the statistics of this game.
        Returns:
        A Map of the statistics.
      • getLocationClass

        public static java.lang.Class<? extends FreeColGameObject> getLocationClass​(java.lang.String id)
        Get a location class from an identifier.
        Parameters:
        id - The identifier to dissect.
        Returns:
        The location class.
      • unserialize

        public <T extends FreeColObject> T unserialize​(java.lang.String xml,
                                                       java.lang.Class<T> returnClass)
                                                throws javax.xml.stream.XMLStreamException
        Unserialize from XML to a FreeColObject in this game.
        Type Parameters:
        T - The actual return type.
        Parameters:
        xml - The xml serialized version of an object.
        returnClass - The expected object class.
        Returns:
        The unserialized object.
        Throws:
        javax.xml.stream.XMLStreamException - if there are any problems reading from the stream.
      • setSpecification

        public final void setSpecification​(Specification specification)
        Sets the specification for this object.
        Overrides:
        setSpecification in class FreeColGameObject
        Parameters:
        specification - The Specification to use.
      • copyIn

        public <T extends FreeColObject> boolean copyIn​(T other)
        Copy another FreeColObject into this one if it is compatible.
        Overrides:
        copyIn in class FreeColGameObject
        Type Parameters:
        T - The FreeColObject subclass of the object to copy in.
        Parameters:
        other - The other object.
        Returns:
        True if the copy in is succesful.
      • writeAttributes

        protected void writeAttributes​(FreeColXMLWriter xw)
                                throws javax.xml.stream.XMLStreamException
        Write the attributes of this object to a stream. To be overridden if required by any object that has attributes and uses the toXML(FreeColXMLWriter, String) call.
        Overrides:
        writeAttributes in class FreeColObject
        Parameters:
        xw - The FreeColXMLWriter to write to.
        Throws:
        javax.xml.stream.XMLStreamException - if there are any problems writing to the stream.
      • writeChildren

        protected void writeChildren​(FreeColXMLWriter xw)
                              throws javax.xml.stream.XMLStreamException
        Write the children of this object to a stream. To be overridden if required by any object that has children and uses the toXML(FreeColXMLWriter, String) call.
        Overrides:
        writeChildren in class FreeColObject
        Parameters:
        xw - The FreeColXMLWriter to write to.
        Throws:
        javax.xml.stream.XMLStreamException - if there are any problems writing to the stream.
      • readAttributes

        protected void readAttributes​(FreeColXMLReader xr)
                               throws javax.xml.stream.XMLStreamException
        Reads the attributes of this object from an XML stream.
        Overrides:
        readAttributes in class FreeColGameObject
        Parameters:
        xr - The FreeColXMLReader to read from.
        Throws:
        javax.xml.stream.XMLStreamException - if there is a problem reading the stream.
      • readChildren

        protected void readChildren​(FreeColXMLReader xr)
                             throws javax.xml.stream.XMLStreamException
        Reads the children of this object from an XML stream.
        Overrides:
        readChildren in class FreeColObject
        Parameters:
        xr - The FreeColXMLReader to read from.
        Throws:
        javax.xml.stream.XMLStreamException - if there is a problem reading the stream.
      • readChild

        protected void readChild​(FreeColXMLReader xr)
                          throws javax.xml.stream.XMLStreamException
        Reads a single child object. Subclasses must override to read their enclosed elements. This particular instance of the routine always throws XMLStreamException because we should never arrive here. However it is very useful to always call super.readChild() when an unexpected tag is encountered, as the exception thrown here provides some useful debugging context.
        Overrides:
        readChild in class FreeColObject
        Parameters:
        xr - The FreeColXMLReader to read from.
        Throws:
        javax.xml.stream.XMLStreamException - if there is a problem reading the stream.
      • getXMLTagName

        public java.lang.String getXMLTagName()
        Get the serialization tag for this object.
        Specified by:
        getXMLTagName in class FreeColObject
        Returns:
        The tag.