public class DefendingState extends java.lang.Object implements State
This is the state an agent should be in whenever the ball is within the agent's movement range and neither the team nor the agent has possession of the ball.
This state has only one possible action:
This state can lead to:
Constructor and Description |
---|
DefendingState() |
Modifier and Type | Method and Description |
---|---|
void |
enterState(CommandPlayer context)
Called when a state is entered.
|
void |
exitState(CommandPlayer context)
Called when a state is exited.
|
void |
processModel(CommandPlayer context,
EnvironmentModel model)
Using the current game state, decide what action to take.
|
void |
updateState(StateMachine stateMachine,
EnvironmentModel model)
Go to passive state if the ball moves outside of movement area
Go to support state if another team mate gets the ball
Go to Attack state if this agent wins possession of the ball
|
public void enterState(CommandPlayer context)
State
enterState
in interface State
context
- The agent to which this state appliespublic void exitState(CommandPlayer context)
State
public void processModel(CommandPlayer context, EnvironmentModel model)
State
processModel
in interface State
context
- The agent to which this state appliesmodel
- Model containing the current game state.public void updateState(StateMachine stateMachine, EnvironmentModel model)
updateState
in interface State
stateMachine
- State Machine to update.model
- Model containing the current game state.