public class GameSpecification
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.lang.String |
boardBackgroundFileName
path to a file that contains an image for the game window background
|
java.util.ArrayList<CameraObjectType> |
cameraObjectTypes
lists specifications of objects to be detected by the camera when playing on real-world game board
|
java.util.Map<java.lang.String,Element> |
elements
list of elements indexed through their name
|
java.util.Map<java.lang.String,ElementType> |
elementTypes
list of element types indexed through their name
|
java.util.Map<java.lang.String,Expression> |
expressions
list of all expressions.
|
java.lang.String |
gameName
name of the game
|
int |
initialPlayerScore
initial scores for all players
|
java.util.Map<java.lang.String,Location> |
locations
list of locations indexed through their name
|
java.util.Map<java.lang.String,LocationType> |
locationTypes
list of location types indexed through their name
|
java.lang.String[] |
playerNames
names of players - just for visualization
|
java.util.Map<java.lang.String,GameRule> |
rules
lists all the game rules, indexed by their name
|
java.util.ArrayList<GameScoring> |
scorings
specifies how the players scores change if particular game states are reached
|
java.util.Map<Expr,Expr> |
terminationConditions
list of conditions expressions that determine the game is over, if
they evaluate to true.
|
Constructor and Description |
---|
GameSpecification(Config config,
GameLogger logger)
construct a new empty game specification
|
Modifier and Type | Method and Description |
---|---|
Location |
findClosestCameraLocation(int x,
int y)
find a camera location which is closest to a specified pixel
|
boolean |
load(java.lang.String gameName)
load game specification from a file
|
public java.lang.String gameName
public java.lang.String boardBackgroundFileName
public java.util.Map<java.lang.String,LocationType> locationTypes
public java.util.Map<java.lang.String,ElementType> elementTypes
public java.util.Map<java.lang.String,Element> elements
public java.util.Map<java.lang.String,Location> locations
public java.util.Map<java.lang.String,Expression> expressions
public java.util.Map<Expr,Expr> terminationConditions
public java.util.ArrayList<GameScoring> scorings
public java.util.Map<java.lang.String,GameRule> rules
public java.util.ArrayList<CameraObjectType> cameraObjectTypes
public java.lang.String[] playerNames
public int initialPlayerScore
public GameSpecification(Config config, GameLogger logger)
public boolean load(java.lang.String gameName) throws java.lang.Exception
gameName
- the name of game, and the file where the specification is loaded from (in games/ folder)java.lang.Exception
public Location findClosestCameraLocation(int x, int y)
x
- x-coordinate of the pixely
- y-coordinate of the pixel