|
Gridarta Editor
|
Abstract base class for classes implementing GameObjectParsers. More...
Inheritance diagram for net.sf.gridarta.model.io.AbstractGameObjectParser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:
Collaboration diagram for net.sf.gridarta.model.io.AbstractGameObjectParser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:Public Member Functions | |
| void | addModifiedFields (@NotNull final G gameObject, @NotNull final Map< String, String > fields) |
| void | collectTempList (@NotNull final List< G > objects) |
| G | load (@NotNull final BufferedReader reader, @Nullable final Collection< G > objects) throws IOException |
| G | load (@NotNull final BufferedReader reader, @NotNull final String firstLine, @Nullable final Collection< G > objects) throws IOException |
| void | save (@NotNull final Appendable appendable, @NotNull final G gameObject) throws IOException |
Public Member Functions inherited from net.sf.gridarta.model.io.GameObjectParser< G, A, R > | |
| void | addModifiedFields ( @NotNull G gameObject, @NotNull Map< String, String > fields) |
| Adds the modified fields of a GameObject to a map. More... | |
| void | collectTempList ( @NotNull List< G > objects) |
| Browse first through the archetype list and attach map arches to it then browse through the face list and try to find the pictures. More... | |
| Map< String, String > | getModifiedFields ( @NotNull G gameObject) |
| Returns the modified fields of a GameObject. More... | |
| G | load ( @NotNull BufferedReader reader, @Nullable Collection< G > objects) throws IOException |
| Parse a game object from a stream. More... | |
| G | load ( @NotNull BufferedReader reader, @NotNull String firstLine, @Nullable Collection< G > objects) throws IOException |
| Parse a game object from a stream. More... | |
| void | save ( @NotNull Appendable appendable, @NotNull G gameObject) throws IOException |
| Write a game object object to a stream. More... | |
Protected Member Functions | |
| AbstractGameObjectParser (@NotNull final GameObjectFactory< G, A, R > gameObjectFactory, @NotNull final ArchetypeSet< G, A, R > archetypeSet) | |
| Create a new instance. More... | |
| boolean | parseLine (@NotNull final String line, @NotNull final G gameObject) |
| Parse one line. More... | |
Private Member Functions | |
| void | expandMulti (@NotNull final G gameObject, @NotNull final Collection< G > objects) |
| If the given gameObject is a multi-part head, we generate the appropriate tail (from the archetype stack) and attach it. More... | |
Static Private Member Functions | |
| static String | readArchName (@NotNull final BufferedReader reader, @NotNull final String firstLine) throws IOException |
| Read an archetype name. More... | |
Private Attributes | |
| final ArchetypeSet< G, A, R > | archetypeSet |
| The ArchetypeSet for looking up archetypes. More... | |
| final GameObjectFactory< G, A, R > | gameObjectFactory |
| The game object factory for creating new game object instances. More... | |
Static Private Attributes | |
| static final Category | LOG = Logger.getLogger(AbstractGameObjectParser.class) |
| The Logger for printing log messages. More... | |
Abstract base class for classes implementing GameObjectParsers.
This class contains the common code for reading game objects. Subclasses can extend the parser (GameObject). No support for writing is present.
Definition at line 49 of file AbstractGameObjectParser.java.
|
protected |
Create a new instance.
| gameObjectFactory | the game object factory for creating new game object instances |
| archetypeSet | the archetype set for looking up archetypes |
Definition at line 74 of file AbstractGameObjectParser.java.
| void net.sf.gridarta.model.io.AbstractGameObjectParser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.addModifiedFields | ( | @NotNull final G | gameObject, |
| @NotNull final Map< String, String > | fields | ||
| ) |
Definition at line 223 of file AbstractGameObjectParser.java.
Referenced by net.sf.gridarta.var.atrinik.model.io.DefaultGameObjectParser.getModifiedFields(), net.sf.gridarta.var.daimonin.model.io.DefaultGameObjectParser.getModifiedFields(), and net.sf.gridarta.var.crossfire.model.io.DefaultGameObjectParser.getModifiedFields().
Here is the caller graph for this function:| void net.sf.gridarta.model.io.AbstractGameObjectParser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.collectTempList | ( | @NotNull final List< G > | objects | ) |
Definition at line 182 of file AbstractGameObjectParser.java.
|
private |
If the given gameObject is a multi-part head, we generate the appropriate tail (from the archetype stack) and attach it.
The new gameObjects get added to the temp list, not a map. This method should only be called after map-loading. The ArchetypeSet should be fully initialized at this point.
| gameObject | multi-part head that needs tail attached |
| objects | list with objects that should get the tails attached |
Definition at line 264 of file AbstractGameObjectParser.java.
Referenced by net.sf.gridarta.model.io.AbstractGameObjectParser< TestGameObject, TestMapArchObject, TestArchetype >.collectTempList().
Here is the caller graph for this function:| G net.sf.gridarta.model.io.AbstractGameObjectParser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.load | ( | @NotNull final BufferedReader | reader, |
| @Nullable final Collection< G > | objects | ||
| ) | throws IOException |
Definition at line 81 of file AbstractGameObjectParser.java.
Referenced by net.sf.gridarta.model.io.AbstractGameObjectParser< TestGameObject, TestMapArchObject, TestArchetype >.load().
Here is the caller graph for this function:| G net.sf.gridarta.model.io.AbstractGameObjectParser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.load | ( | @NotNull final BufferedReader | reader, |
| @NotNull final String | firstLine, | ||
| @Nullable final Collection< G > | objects | ||
| ) | throws IOException |
Definition at line 96 of file AbstractGameObjectParser.java.
|
protected |
Parse one line.
This function performs actions needed for this editor.
| line | the line to process |
| gameObject | the current game object |
Definition at line 155 of file AbstractGameObjectParser.java.
Referenced by net.sf.gridarta.model.io.AbstractGameObjectParser< TestGameObject, TestMapArchObject, TestArchetype >.load().
Here is the caller graph for this function:
|
staticprivate |
Read an archetype name.
| reader | the reader to read from |
| firstLine | the first line to parse before reading from reader |
| IOException | if an error occurs |
Definition at line 169 of file AbstractGameObjectParser.java.
Referenced by net.sf.gridarta.model.io.AbstractGameObjectParser< TestGameObject, TestMapArchObject, TestArchetype >.load().
Here is the caller graph for this function:| void net.sf.gridarta.model.io.AbstractGameObjectParser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.save | ( | @NotNull final Appendable | appendable, |
| @NotNull final G | gameObject | ||
| ) | throws IOException |
Definition at line 195 of file AbstractGameObjectParser.java.
Referenced by net.sf.gridarta.model.io.AbstractGameObjectParser< TestGameObject, TestMapArchObject, TestArchetype >.save().
Here is the caller graph for this function:
|
private |
The ArchetypeSet for looking up archetypes.
Definition at line 66 of file AbstractGameObjectParser.java.
Referenced by net.sf.gridarta.model.io.AbstractGameObjectParser< TestGameObject, TestMapArchObject, TestArchetype >.AbstractGameObjectParser().
|
private |
The game object factory for creating new game object instances.
Definition at line 60 of file AbstractGameObjectParser.java.
Referenced by net.sf.gridarta.model.io.AbstractGameObjectParser< TestGameObject, TestMapArchObject, TestArchetype >.AbstractGameObjectParser().
|
staticprivate |
The Logger for printing log messages.
Definition at line 54 of file AbstractGameObjectParser.java.