Package net.sf.gridarta.model.io
Interface GameObjectParser<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
-
- All Known Implementing Classes:
AbstractGameObjectParser,DefaultGameObjectParser,DefaultGameObjectParser,DefaultGameObjectParser
public interface GameObjectParser<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>Interface for classes that read or writeGameObjectinstances.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddModifiedFields(G gameObject, @NotNull java.util.Map<java.lang.String,java.lang.String> fields)Adds the modified fields of aGameObjectto a map.voidcollectTempList(@NotNull java.util.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.@NotNull java.util.Map<java.lang.String,java.lang.String>getModifiedFields(G gameObject)Returns the modified fields of aGameObject.Gload(@NotNull java.io.BufferedReader reader, @NotNull java.lang.String firstLine, @Nullable java.util.Collection<G> objects)Parse a game object from a stream.Gload(@NotNull java.io.BufferedReader reader, @Nullable java.util.Collection<G> objects)Parse a game object from a stream.voidsave(@NotNull java.lang.Appendable appendable, G gameObject)Write a game object object to a stream.
-
-
-
Method Detail
-
load
@Nullable G load(@NotNull @NotNull java.io.BufferedReader reader, @Nullable @Nullable java.util.Collection<G> objects) throws java.io.IOException
Parse a game object from a stream.- Parameters:
reader- the stream to readobjects- if non-null, add the read game objects to this collection- Returns:
- the read game object, or
nullif the end of the stream was reached - Throws:
java.io.IOException- if the stream cannot be read or if a parsing error occurs
-
load
@Nullable G load(@NotNull @NotNull java.io.BufferedReader reader, @NotNull @NotNull java.lang.String firstLine, @Nullable @Nullable java.util.Collection<G> objects) throws java.io.IOException
Parse a game object from a stream.- Parameters:
reader- the stream to readfirstLine- the first line to parse before reading fromreaderobjects- if non-null, add the read game objects to this collection- Returns:
- the read game object, or
nullif the end of the stream was reached - Throws:
java.io.IOException- if the stream cannot be read or if a parsing error occurs
-
save
void save(@NotNull @NotNull java.lang.Appendable appendable, @NotNull G gameObject) throws java.io.IOExceptionWrite a game object object to a stream.- Parameters:
appendable- the stream to write togameObject- the game object to write- Throws:
java.io.IOException- if the stream cannot be written
-
collectTempList
void collectTempList(@NotNull @NotNull java.util.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:
objects- the list of game objects to collect
-
getModifiedFields
@NotNull @NotNull java.util.Map<java.lang.String,java.lang.String> getModifiedFields(@NotNull G gameObject)Returns the modified fields of aGameObject. These fields are written into map files.- Parameters:
gameObject- the game object- Returns:
- the modified fields in writing order
-
addModifiedFields
void addModifiedFields(@NotNull G gameObject, @NotNull @NotNull java.util.Map<java.lang.String,java.lang.String> fields)Adds the modified fields of aGameObjectto a map.- Parameters:
gameObject- the game objectfields- the map to update
-
-