public class VGDLParser
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
int |
currentSet
Current set through the game description file.
|
Game |
game
Game which description is being read.
|
Constructor and Description |
---|
VGDLParser()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
Node |
indentTreeParser(java.lang.String[] lines)
Builds the tree structure that defines the game.
|
void |
modifyTheSpriteRender(Game currentGame,
java.util.ArrayList<Node> elements)
Modify the order of the sprites during rendering to another sprite set tree
|
Game |
parseGame(java.lang.String gamedesc_file)
Parses a game passed whose file is passed by parameter.
|
Game |
parseGameWithParameters(java.lang.String gamedesc_file,
java.util.HashMap<java.lang.String,ParameterContent> parameters)
Parses a game passed whose file is passed by parameter.
|
void |
parseInteractionTermination(Game currentGame,
java.lang.String[] rules,
java.lang.String[] terminations)
parse both rules and termination and add them to the current game object
|
void |
parseSpriteSet(Game currentGame,
java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> spriteStruct,
java.util.HashMap<java.lang.String,java.lang.String> sprites)
Parse a custom sprite set
|
public Game game
public int currentSet
public Game parseGame(java.lang.String gamedesc_file)
gamedesc_file
- filename of the file containing the gamepublic Game parseGameWithParameters(java.lang.String gamedesc_file, java.util.HashMap<java.lang.String,ParameterContent> parameters)
gamedesc_file
- filename of the file containing the gamepublic void parseSpriteSet(Game currentGame, java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> spriteStruct, java.util.HashMap<java.lang.String,java.lang.String> sprites)
currentGame
- the current game to modifyspriteStruct
- the current structure of the sprite setsprites
- the current spritespublic void parseInteractionTermination(Game currentGame, java.lang.String[] rules, java.lang.String[] terminations)
currentGame
- the current game objectrules
- the current interaction set as in the VGDL fileterminations
- the current termination set as in the VGDL filejava.lang.Exception
public Node indentTreeParser(java.lang.String[] lines)
lines
- array with the lines read from the game description file.