Class FreeColMapLoader

  • All Implemented Interfaces:
    MapLoader

    public class FreeColMapLoader
    extends java.lang.Object
    implements MapLoader
    Load a FreeCol map.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Map importMap  
      private static java.util.logging.Logger logger  
    • Constructor Summary

      Constructors 
      Constructor Description
      FreeColMapLoader​(java.io.File file)
      Constructor for the FreeColMapLoader class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Map.Layer getHighestLayer()
      Returns the highest layer this MapLoader is able to load.
      Map.Layer loadMap​(Game game, Map.Layer layer)
      Load a map into the given game, copying all layers up to the given layer.
      • 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
      • importMap

        private Map importMap
    • Constructor Detail

      • FreeColMapLoader

        public FreeColMapLoader​(java.io.File file)
                         throws FreeColException,
                                java.io.IOException,
                                javax.xml.stream.XMLStreamException
        Constructor for the FreeColMapLoader class.
        Parameters:
        file - The File to load.
        Throws:
        FreeColException - if the format is incompatible.
        java.io.IOException - if the stream can not be created.
        javax.xml.stream.XMLStreamException - if there is a problem reading the stream.
    • Method Detail

      • loadMap

        public Map.Layer loadMap​(Game game,
                                 Map.Layer layer)
        Load a map into the given game, copying all layers up to the given layer. Returns the highest layer actually copied, e.g. NONE if map loading failed, or the highest level available if an even higher level was requested.
        Specified by:
        loadMap in interface MapLoader
        Parameters:
        game - a Game value
        layer - a Layer value
        Returns:
        a Layer value
      • getHighestLayer

        public Map.Layer getHighestLayer()
        Returns the highest layer this MapLoader is able to load.
        Specified by:
        getHighestLayer in interface MapLoader
        Returns:
        a Layer value