public class Context
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
Robot |
robot
reference to robot - to be able to perform internal MOVE command when required by an expression
|
GameSpecification |
specs
reference to game specification
|
Constructor and Description |
---|
Context(GameState state,
GameSpecification specs,
Robot robot)
construct a new empty context
|
Modifier and Type | Method and Description |
---|---|
Expression |
getExpr(java.lang.String exprName)
the expression to which the specified expression name is mapped, or null if expressions do not contain exprName
|
GameState |
getState()
retrieve the game sate in this context
|
Expr |
getVar(java.lang.String var)
the value to which the specified variable name is mapped, or null if variables do not contain var
|
void |
setState(GameState state)
set the game state for this context - the same context is reused when
searching through the game tree, a particular current state always
needs to be set
|
void |
setVar(java.lang.String var,
Expr val) |
public Robot robot
public GameSpecification specs
public Context(GameState state, GameSpecification specs, Robot robot)
public void setState(GameState state)
public GameState getState()
public void setVar(java.lang.String var, Expr val)
public Expr getVar(java.lang.String var)
public Expression getExpr(java.lang.String exprName)