Package net.sf.gridarta.model.io
Class DefaultMapReader<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.model.io.DefaultMapReader<G,A,R>
-
- All Implemented Interfaces:
MapReader<G,A>
public class DefaultMapReader<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.Object implements MapReader<G,A>
Default implementation ofMapReader.
-
-
Constructor Summary
Constructors Constructor Description DefaultMapReader(@NotNull MapArchObjectParserFactory<A> mapArchObjectParserFactory, @NotNull MapArchObjectFactory<A> mapArchObjectFactory, @NotNull GameObjectParser<G,A,R> gameObjectParser, @NotNull java.io.File file)Open a file for reading it as a map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull java.util.List<G>getGameObjects()Return the decoded game objects.AgetMapArchObject()Returns the MapArchObject read from this MapFileDecode.
-
-
-
Constructor Detail
-
DefaultMapReader
public DefaultMapReader(@NotNull @NotNull MapArchObjectParserFactory<A> mapArchObjectParserFactory, @NotNull @NotNull MapArchObjectFactory<A> mapArchObjectFactory, @NotNull @NotNull GameObjectParser<G,A,R> gameObjectParser, @NotNull @NotNull java.io.File file) throws java.io.IOExceptionOpen a file for reading it as a map.- Parameters:
mapArchObjectParserFactory- the map arch object parser factory instancemapArchObjectFactory- the map arch object factory instancegameObjectParser- the game object parser instancefile- the file to open- Throws:
java.io.IOException- in case the file couldn't be readInvalidMapFormatException- in case the file is in wrong format
-
-
Method Detail
-
getMapArchObject
@NotNull public A getMapArchObject()
Description copied from interface:MapReaderReturns the MapArchObject read from this MapFileDecode.- Specified by:
getMapArchObjectin interfaceMapReader<G extends GameObject<G,A,R>,A extends MapArchObject<A>>- Returns:
- the map arch object read from this map file decode
-
getGameObjects
@NotNull public @NotNull java.util.List<G> getGameObjects()
Description copied from interface:MapReaderReturn the decoded game objects.- Specified by:
getGameObjectsin interfaceMapReader<G extends GameObject<G,A,R>,A extends MapArchObject<A>>- Returns:
- the decoded game objects
-
-