|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface that can be passed to an agent to let it know
what's going on in the environment. This is an agent's
only window into the state of the environment, and the information
provided is agent-centric (in other words, the point of
reference is the agent's current location).
All methods return booleans that describe whether the particular
environment property is true.
During the game, an AgentEnvironment
object will be passed
in to your agent through your agent's getMove
method.
You can inspect the environment using the methods provided by the
AgentEnvironment
.
Field Summary | |
static int |
ENEMY_TEAM
Enemy team identifier constant. |
static int |
OUR_TEAM
Our team identifier constant. |
Method Summary | |
boolean |
hasFlag()
Returns true iff this agent has the enemy flag. |
boolean |
hasFlag(int inTeam)
Returns true iff an agent on the specified team has the other team's flag. |
boolean |
isAgentEast(int inTeam,
boolean inImmediate)
Returns true iff an agent from the specified team is somewhere to the east of this agent (to right of agent's current horizontal position). |
boolean |
isAgentNorth(int inTeam,
boolean inImmediate)
Returns true iff an agent from the specified team is somewhere to the north of this agent (above agent's current vertical position). |
boolean |
isAgentSouth(int inTeam,
boolean inImmediate)
Returns true iff an agent from the specified team is somewhere to the south of this agent (below agent's current vertical position). |
boolean |
isAgentWest(int inTeam,
boolean inImmediate)
Returns true iff an agent from the specified team is somewhere to the west of this agent (to left of agent's current horizontal position). |
boolean |
isBaseEast(int inTeam,
boolean inImmediate)
Returns true iff the specified team's base is somewhere to the east of this agent (above agent's current vertical position). |
boolean |
isBaseNorth(int inTeam,
boolean inImmediate)
Returns true iff the specified team's base is somewhere to the north of this agent (above agent's current vertical position). |
boolean |
isBaseSouth(int inTeam,
boolean inImmediate)
Returns true iff the specified team's base is somewhere to the south of this agent (above agent's current vertical position). |
boolean |
isBaseWest(int inTeam,
boolean inImmediate)
Returns true iff the specified team's base is somewhere to the west of this agent (above agent's current vertical position). |
boolean |
isFlagEast(int inTeam,
boolean inImmediate)
Returns true iff the specified team's flag is somewhere to the east of this agent (to right of agent's current horizontal position). |
boolean |
isFlagNorth(int inTeam,
boolean inImmediate)
Returns true iff the specified team's flag is somewhere to the north of this agent (above agent's current vertical position). |
boolean |
isFlagSouth(int inTeam,
boolean inImmediate)
Returns true iff the specified team's flag is somewhere to the south of this agent (below agent's current vertical position). |
boolean |
isFlagWest(int inTeam,
boolean inImmediate)
Returns true iff the specified team's flag is somewhere to the west of this agent (to left of agent's current horizontal position). |
boolean |
isObstacleEastImmediate()
Returns true an obstacle is in the space immediately east of this agent. |
boolean |
isObstacleNorthImmediate()
Returns true an obstacle is in the space immediately north of this agent. |
boolean |
isObstacleSouthImmediate()
Returns true an obstacle is in the space immediately south of this agent. |
boolean |
isObstacleWestImmediate()
Returns true an obstacle is in the space immediately north of this agent. |
Field Detail |
public static final int OUR_TEAM
public static final int ENEMY_TEAM
Method Detail |
public boolean isFlagNorth(int inTeam, boolean inImmediate)
inTeam
- check for flag of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate
- set to true if trying to check only
space immediately to the north of this agent (and thus
spaces further away are ignored).public boolean isFlagSouth(int inTeam, boolean inImmediate)
inTeam
- check for flag of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate
- set to true if trying to check only
space immediately to the south of this agent (and thus
spaces further away are ignored).public boolean isFlagEast(int inTeam, boolean inImmediate)
inTeam
- check for flag of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate
- set to true if trying to check only
space immediately to the east of this agent (and thus
spaces further away are ignored).public boolean isFlagWest(int inTeam, boolean inImmediate)
inTeam
- check for flag of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate
- set to true if trying to check only
space immediately to the west of this agent (and thus
spaces further away are ignored).public boolean isBaseNorth(int inTeam, boolean inImmediate)
inTeam
- check for base of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate
- set to true if trying to check only
space immediately to the north of this agent (and thus
spaces further away are ignored).public boolean isBaseSouth(int inTeam, boolean inImmediate)
inTeam
- check for base of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate
- set to true if trying to check only
space immediately to the south of this agent (and thus
spaces further away are ignored).public boolean isBaseEast(int inTeam, boolean inImmediate)
inTeam
- check for base of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate
- set to true if trying to check only
space immediately to the east of this agent (and thus
spaces further away are ignored).public boolean isBaseWest(int inTeam, boolean inImmediate)
inTeam
- check for base of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate
- set to true if trying to check only
space immediately to the west of this agent (and thus
spaces further away are ignored).public boolean isAgentNorth(int inTeam, boolean inImmediate)
inTeam
- check for agent of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate
- set to true if trying to check only
space immediately to the north of this agent (and thus
spaces further away are ignored).public boolean isAgentSouth(int inTeam, boolean inImmediate)
inTeam
- check for agent of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate
- set to true if trying to check only
space immediately to the south of this agent (and thus
spaces further away are ignored).public boolean isAgentEast(int inTeam, boolean inImmediate)
inTeam
- check for agent of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate
- set to true if trying to check only
space immediately to the east of this agent (and thus
spaces further away are ignored).public boolean isAgentWest(int inTeam, boolean inImmediate)
inTeam
- check for agent of this team, valid values
in [OUR_TEAM, ENEMY_TEAM].inImmediate
- set to true if trying to check only
space immediately to the west of this agent (and thus
spaces further away are ignored).public boolean hasFlag()
public boolean hasFlag(int inTeam)
inTeam
- check if this team has the other team's flag, valid values
in [OUR_TEAM, ENEMY_TEAM].public boolean isObstacleNorthImmediate()
public boolean isObstacleSouthImmediate()
public boolean isObstacleEastImmediate()
public boolean isObstacleWestImmediate()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |