# Option playing Plays soccer. Chooses following option according to current role. ## State Machine ## State playing-goalie
If that state is active,
> | The option playing-goalie is executed.
> | These output symbols are set:
| sent-game-state | = | sent-game-state.playing
The decision tree:
Pseudo code of the decision tree:
if ( | role == goalie | ) | // role is goalie
{
transition-to-state(playing-goalie);
}
else if ( | strategy.ball-is-handled-at-the-moment | ) | // ball is handled
{
transition-to-state(playing-striker);
}
else if ( | subsequent-option-reached-target-state | ) | // following option is in target state
{
transition-to-state(playing-striker);
}
else
{
transition-to-state(playing-goalie);
}

## State playing-striker

If that state is active,
> | The option playing-striker is executed.
> | These output symbols are set:
| sound-request | = | sound-request.rob002
| sent-game-state | = | sent-game-state.playing
The decision tree:
Pseudo code of the decision tree:
if ( | role == goalie | ) | // role is goalie
{
transition-to-state(playing-goalie);
}
else if ( | strategy.ball-is-handled-at-the-moment | ) | // ball is handled
{
transition-to-state(playing-striker);
}
else if ( | subsequent-option-reached-target-state | ) | // following option is in target state
{
transition-to-state(playing-striker);
}
else
{
transition-to-state(playing-striker);
}