finishes state flow and adds temp audio

This commit is contained in:
Marcel 2024-05-27 10:19:28 +02:00
parent bc5d7e1941
commit 43d31651cd
6 changed files with 65 additions and 7 deletions

View file

@ -1,6 +1,7 @@
#include "states.h"
#include "state.h"
#include "station.h"
#include "sounds.h"
Startup::Startup() = default;
@ -26,6 +27,10 @@ String Startup::updateDisplay()
"on first station";
}
void Startup::activated(Context context)
{
}
//------------------------------------
@ -48,6 +53,11 @@ String WaitingForGameStart::updateDisplay()
"Start...";
}
void WaitingForGameStart::activated(const Context context)
{
context.dfPlayer->play(IDLE);
}
//------------------------------------
@ -81,6 +91,18 @@ String OnTheMove::updateDisplay()
return "On the Move... ";
}
void OnTheMove::activated(const Context context)
{
const int index = context.getStationIndex(this->targetStation);
if (index == 1)
{
context.dfPlayer->play(REMOVED_FROM_MAIN_STATION);
} else
{
context.dfPlayer->play(REMOVED_FROM_SIDE_STATION);
}
}
//------------------------------------
@ -105,6 +127,10 @@ String IncorrectStation::updateDisplay()
return "Wrong Station! ";
}
void IncorrectStation::activated(Context context)
{
}
//------------------------------------
@ -139,6 +165,11 @@ String Hacking::updateDisplay()
return "Hacking B)";
}
void Hacking::activated(const Context context)
{
context.dfPlayer->play(OBJECT_PLACED_ON_MAIN_STATION);
}
//------------------------------------
@ -167,6 +198,10 @@ String Complain::updateDisplay()
return "Put me back!!";
}
void Complain::activated(Context context)
{
}
//------------------------------------
@ -192,6 +227,14 @@ String WaitingForPickup::updateDisplay()
return "Pick me up ";
}
void WaitingForPickup::activated(Context context)
{
}
//------------------------------------
End::End() = default;
@ -211,3 +254,8 @@ String End::updateDisplay()
{
return "END...";
}
void End::activated(Context context)
{
context.dfPlayer->play(GAME_WON);
}