Gamemaster
Gamemaster
ES_Event runGameMaster(ES_Event ThisEvent){ //This function runs the top level hierarchical state machine for
the gameplay service
//store the current event
//declare a return event
//assume no errors
//set the next state equal to the current state, assume no state transition
//assume we're not changing states
// end if
// if current state is finalCountdown
//run the during function of this state before handling the event at this level
// if this event type
//if a timer timed out
//if the game is over
//declare a new event
//the event indicates we should shut off the motors at
// the game's end
//turn on the construction active LED
//go back to the initial state of waiting for the game
//to start
//indicate that we're changing states
//end if
// end if
// if MakeTransition is set to true
{
// set current event to ES_EXIT currentEvent.EventType = ES_EXIT;
// run GameMaster using currentEvent
// set currentState to nextState
// runGameMaster using EntryEventKind
}
//return the event, assume no errors
}