Gridarta Editor
net.sf.gridarta.model.io.AbstractMapArchObjectParser< A extends MapArchObject< A > Class Template Referenceabstract

Abstract base class for classes implementing MapArchObjectParsers. More...

+ Inheritance diagram for net.sf.gridarta.model.io.AbstractMapArchObjectParser< A extends MapArchObject< A >:
+ Collaboration diagram for net.sf.gridarta.model.io.AbstractMapArchObjectParser< A extends MapArchObject< A >:

Public Member Functions

void load (@NotNull final BufferedReader reader, @NotNull final A mapArchObject) throws IOException
 
- Public Member Functions inherited from net.sf.gridarta.model.io.MapArchObjectParser< A >
void load ( @NotNull BufferedReader reader, @NotNull A mapArchObject) throws IOException
 Parse a map arch object from a stream. More...
 
void save ( @NotNull Appendable appendable, @NotNull A mapArchObject, @Nullable MapFile mapFile) throws IOException
 Write a map arch object to a stream. More...
 

Protected Member Functions

abstract boolean parseLine (@NotNull String line, @NotNull A mapArchObject, @NotNull BufferedReader reader) throws IOException
 Parse a line for this editor type. More...
 

Static Private Attributes

static final Pattern TILE_PATH_PATTERN = Pattern.compile("(\\d+) (.+)")
 Matches the remainder of a "tile_path_xyz" line. More...
 

Detailed Description

Abstract base class for classes implementing MapArchObjectParsers.

This class contains the common code for reading map game objects. Subclasses can extend the parser (MapArchObject, BufferedReader). No support for writing is present.

Author
Andreas Kirschbaum

Definition at line 40 of file AbstractMapArchObjectParser.java.

Member Function Documentation

◆ load()

void net.sf.gridarta.model.io.AbstractMapArchObjectParser< A extends MapArchObject< A >.load ( @NotNull final BufferedReader  reader,
@NotNull final A  mapArchObject 
) throws IOException

Definition at line 50 of file AbstractMapArchObjectParser.java.

◆ parseLine()

abstract boolean net.sf.gridarta.model.io.AbstractMapArchObjectParser< A extends MapArchObject< A >.parseLine ( @NotNull String  line,
@NotNull A  mapArchObject,
@NotNull BufferedReader  reader 
) throws IOException
abstractprotected

Parse a line for this editor type.

Parameters
linethe line to parse
mapArchObjectthe map arch object to update
readerthe reader for reading additional lines
Returns
whether the line has been consumed
Exceptions
IOExceptionif an I/O error occurs

Referenced by net.sf.gridarta.model.io.AbstractMapArchObjectParser< MapArchObject >.load().

+ Here is the caller graph for this function:

Member Data Documentation

◆ TILE_PATH_PATTERN

final Pattern net.sf.gridarta.model.io.AbstractMapArchObjectParser< A extends MapArchObject< A >.TILE_PATH_PATTERN = Pattern.compile("(\\d+) (.+)")
staticprivate

Matches the remainder of a "tile_path_xyz" line.

First group is the direction, second group is the destination path.

Definition at line 47 of file AbstractMapArchObjectParser.java.


The documentation for this class was generated from the following file: