buenzliai/src/context.cpp
2024-05-27 11:45:36 +02:00

22 lines
484 B
C++

#include "Context.h"
Context::Context(Station* stations, const int stationCount, const unsigned long delta, DFRobotDFPlayerMini* dfPlayer)
{
this->stations = stations;
this->stationCount = stationCount;
this->delta = delta;
this->dfPlayer = dfPlayer;
}
int Context::getStationIndex(const Station* station) const
{
for (int i = 0; i < stationCount; ++i)
{
if (&stations[i] == station)
{
return i;
}
}
return -1;
}