Added more event transitions to facilitate testing.
This commit is contained in:
parent
1a27af361d
commit
2b31cc45e1
3 changed files with 22 additions and 1 deletions
|
@ -406,6 +406,7 @@ static void Playing__Interacting_Do(StateMachineContext_T * context)
|
|||
}
|
||||
break;
|
||||
|
||||
case KEVENT_PLAY_PRESSED_ON_REMOTE:
|
||||
case KEVENT_GAME_OVER:
|
||||
{
|
||||
AudioAction_T audio_action = {.ID = AUDIO_PLAY_GAME_OVER, .Play_To_Completion = true};
|
||||
|
@ -413,6 +414,21 @@ static void Playing__Interacting_Do(StateMachineContext_T * context)
|
|||
Transition_For_Event(context, STATE_WRAPPING_UP, &Event);
|
||||
}
|
||||
break;
|
||||
|
||||
case KEVENT_MENU_UP:
|
||||
{
|
||||
#ifdef LOG_INTERACTING_SUBSTATE
|
||||
KLOG_INFO(KLOG_TAG, "Simulating a tag leading to being tagged out.");
|
||||
#endif // LOG_INTERACTING_SUBSTATE
|
||||
Reduce_Health(Get_Max_Health());
|
||||
|
||||
AudioAction_T audio_action = {.ID = AUDIO_PLAY_TAG_RECEIVED, .Data = (void *)0x00};
|
||||
Perform_Audio_Action(&audio_action);
|
||||
|
||||
NeoPixelsAction_T neopixels_action = {.ID = NEOPIXELS_TAG_RECEIVED, .Prominence = NEOPIXELS_FOREGROUND, .Data = (void *)&ReceivedTagColor};
|
||||
xQueueSend(xQueueNeoPixels, &neopixels_action, 0);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// All other events are ignored in this state.
|
||||
|
|
|
@ -185,6 +185,7 @@ static void Playing__Tagged_Out_Do(StateMachineContext_T * context)
|
|||
}
|
||||
break;
|
||||
|
||||
case KEVENT_PLAY_PRESSED_ON_REMOTE:
|
||||
case KEVENT_GAME_OVER:
|
||||
{
|
||||
AudioAction_T audio_action = {.ID = AUDIO_PLAY_GAME_OVER, .Play_To_Completion = true};
|
||||
|
@ -193,7 +194,7 @@ static void Playing__Tagged_Out_Do(StateMachineContext_T * context)
|
|||
}
|
||||
break;
|
||||
|
||||
case KEVENT_PLAY_PRESSED_ON_REMOTE:
|
||||
case KEVENT_MENU_DOWN:
|
||||
Set_Health(Get_Max_Health());
|
||||
Reset_Bombs();
|
||||
Transition_For_Event(context, STATE_PLAYING__INTERACTING, &Event);
|
||||
|
|
|
@ -118,6 +118,10 @@ static void Wrapping_Up_Do(StateMachineContext_T * context)
|
|||
BLE_FreePacketBuffer(Event.Data);
|
||||
}
|
||||
break;
|
||||
|
||||
case KEVENT_PLAY_PRESSED_ON_REMOTE:
|
||||
Transition_For_Event(context, STATE_CONFIGURING, &Event);
|
||||
break;
|
||||
|
||||
default:
|
||||
// All other events are ignored in this state.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue