Professional Documents
Culture Documents
DuringGameNotActive
DuringFaceOff
DuringOffense
DuringDefense
InitGameMasterSM
save our priority
Start the Master State machine
End of InitGameMasterSM
PostGameMasterSM
Post an event to service with saved priority number
RunGameMasterSM
If event is EV_FACEOFF
Execute action function for GameNotActive, EV_FACEOFF
Decide next state to be FaceOff
for internal transitions, skip changing MakeTransition
mark that we are taking a transition
if transitioning to a state with history change kind of entry
we will decide if we need a history state or not
end of this block
end of this block
If event is EV_REDPO
Execute action function for FaceOff, EV_REDPO
if we are TEAM RED, set NextState to Offense, otherwise set
to Defense
for internal transitions, skip changing MakeTransition
mark that we are taking a transition
if transitioning to a state with history change kind of entry
we will decide if we need a history state or not
end of this block
If event is EV_BLUEPO
Execute action function for FaceOff, EV_BLUEPO
if we are TEAM BLUE, set NextState to Offense, otherwise set
to Defense
for internal transitions, skip changing MakeTransition
mark that we are taking a transition
if transitioning to a state with history change kind of entry
end of this block
If event is EV_FACEOFF
Execute action function for FaceOff: EV_FACEOFF
set NextState to FaceOff
for internal transitions, skip changing MakeTransition
mark that we are not taking a transition
if transitioning to a state with history change kind of entry
we will decide if we need a history state or not
end of this block
If event is EV_REDPO
Execute action function for Offense, EV_REDPO
if we are TEAM RED, set NextState to Offense without
transiting state
else set NextState to Defense with transiting state
If event is EV_BLUEPO
Execute action function for Offense, EV_BLUEPO
if we are TEAM BLUE, set NextState to Offense without
transiting state
else set NextState to Defense with transiting state
If event is EV_FACEOFF
Execute action function for Offense: EV_FACEOFF
for internal transitions, skip changing MakeTransition
set NextState to FaceOff
mark that we are taking a transition
if transitioning to a state with history change kind of entry
we will decide if we need a history state or not
end of this block
If event is EV_BLUEPO
Execute action function for Defense, EV_BLUEPO
if we are TEAM BLUE, set NextState to Offense with transiting
state
else set NextState to Defense without transiting state
If event is EV_FACEOFF
Execute action function for Defense, EV_FACEOFF
set NextState to FaceOff
for internal transitions, skip changing MakeTransition
mark that we are taking a transition
if transitioning to a state with history change kind of entry
we will decide if we need a history state or not
end of this block
If event is ES_TIMEOUT
set NextState to FaceOff
mark that we are making a transition
end of this block
after that start any lower level machines that run in this state
else if ES_EXIT
on exit, give the lower levels a chance to clean up first
repeat for any concurrently running state machines
now do any local exit functionality
turn on game indicator
grab team color info from GetTeamColor()
Light up corresponding LED (red or blue)
else
do the 'during' function for this state
run any lower level state machine
return either Event, if you don't want to allow the lower level machine
to remap the current event, or ReturnEvent if you do want to allow it.
End of DuringGameNotActive
DuringFaceOff
assme no re-mapping or comsumption
return either Event, if you don't want to allow the lower level machine
to remap the current event, or ReturnEvent if you do want to allow it.
End of DuringFaceOff
DuringOffense
assme no re-mapping or comsumption
return either Event, if you don't want to allow the lower level machine
to remap the current event, or ReturnEvent if you do want to allow it.
End of DuringOffense
DuringDefense
assme no re-mapping or comsumption
return either Event, if you don't want to allow the lower level machine
to remap the current event, or ReturnEvent if you do want to allow it.
End of DuringDefense