## Summary * Give activities name and log when entering and exiting them * Clearer logs when attempting to debug, knowing where users are coming from/going to helps
23 lines
686 B
C++
23 lines
686 B
C++
#pragma once
|
|
#include <InputManager.h>
|
|
|
|
#include <utility>
|
|
|
|
class GfxRenderer;
|
|
|
|
class Activity {
|
|
protected:
|
|
std::string name;
|
|
GfxRenderer& renderer;
|
|
InputManager& inputManager;
|
|
|
|
public:
|
|
explicit Activity(std::string name, GfxRenderer& renderer, InputManager& inputManager)
|
|
: name(std::move(name)), renderer(renderer), inputManager(inputManager) {}
|
|
virtual ~Activity() = default;
|
|
virtual void onEnter() { Serial.printf("[%lu] [ACT] Entering activity: %s\n", millis(), name.c_str()); }
|
|
virtual void onExit() { Serial.printf("[%lu] [ACT] Exiting activity: %s\n", millis(), name.c_str()); }
|
|
virtual void loop() {}
|
|
virtual bool skipLoopDelay() { return false; }
|
|
};
|