Gridarta Editor
net.sf.gridarta.model.io.GameObjectParser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R > Interface Template Reference

Interface for classes that read or write GameObject instances. More...

+ Inheritance diagram for net.sf.gridarta.model.io.GameObjectParser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:
+ Collaboration diagram for net.sf.gridarta.model.io.GameObjectParser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:

Public Member Functions

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...
 
load (@NotNull BufferedReader reader, @Nullable Collection< G > objects) throws IOException
 Parse a game object from a stream. More...
 
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...
 

Detailed Description

Interface for classes that read or write GameObject instances.

Author
Andreas Kirschbaum

Definition at line 37 of file GameObjectParser.java.

Member Function Documentation

◆ addModifiedFields()

void net.sf.gridarta.model.io.GameObjectParser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.addModifiedFields ( @NotNull G  gameObject,
@NotNull Map< String, String >  fields 
)

Adds the modified fields of a GameObject to a map.

Parameters
gameObjectthe game object
fieldsthe map to update

◆ collectTempList()

void net.sf.gridarta.model.io.GameObjectParser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.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.

Parameters
objectsthe list of game objects to collect

Referenced by net.sf.gridarta.model.resource.AbstractResources<?, ?, ?>.finishRead().

+ Here is the caller graph for this function:

◆ getModifiedFields()

Map<String, String> net.sf.gridarta.model.io.GameObjectParser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getModifiedFields ( @NotNull G  gameObject)

Returns the modified fields of a GameObject.

These fields are written into map files.

Parameters
gameObjectthe game object
Returns
the modified fields in writing order

Referenced by net.sf.gridarta.gui.map.renderer.ToolTipAppender< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.appendGameObject().

+ Here is the caller graph for this function:

◆ load() [1/2]

G net.sf.gridarta.model.io.GameObjectParser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.load ( @NotNull BufferedReader  reader,
@Nullable Collection< G >  objects 
) throws IOException

Parse a game object from a stream.

Parameters
readerthe stream to read
objectsif non-
null
, add the read game objects to this collection
Returns
the read game object, or
null
if the end of the stream was reached
Exceptions
IOExceptionif the stream cannot be read or if a parsing error occurs

Referenced by net.sf.gridarta.var.atrinik.model.io.ArchetypeParser.processLine(), and net.sf.gridarta.var.crossfire.model.io.ArchetypeParser.processLine().

+ Here is the caller graph for this function:

◆ load() [2/2]

G net.sf.gridarta.model.io.GameObjectParser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.load ( @NotNull BufferedReader  reader,
@NotNull String  firstLine,
@Nullable Collection< G >  objects 
) throws IOException

Parse a game object from a stream.

Parameters
readerthe stream to read
firstLinethe first line to parse before reading from
reader
objectsif non-
null
, add the read game objects to this collection
Returns
the read game object, or
null
if the end of the stream was reached
Exceptions
IOExceptionif the stream cannot be read or if a parsing error occurs

◆ save()

void net.sf.gridarta.model.io.GameObjectParser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.save ( @NotNull Appendable  appendable,
@NotNull G  gameObject 
) throws IOException

Write a game object object to a stream.

Parameters
appendablethe stream to write to
gameObjectthe game object to write
Exceptions
IOExceptionif the stream cannot be written

Referenced by net.sf.gridarta.model.io.DefaultMapWriter< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.encodeMapFile(), net.sf.gridarta.var.atrinik.model.collectable.AtrinikArchetypeSetCollectable.writeArchetype(), and net.sf.gridarta.var.crossfire.model.collectable.CrossfireArchetypeSetCollectable.writeArchetype().

+ Here is the caller graph for this function:

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