feat: add interactable component and test button

This commit is contained in:
2026-10-16 23:25:11 +02:00
parent faba4171ec
commit 7dd5ee7903
14 changed files with 236 additions and 6 deletions
@@ -0,0 +1,31 @@
#ifndef LIGHTKEEPER_INTERACTABLEBUTTON_H
#define LIGHTKEEPER_INTERACTABLEBUTTON_H
#include <components/Interactable.h>
#include <cstddef>
class InteractableButton final : public Interactable {
public:
explicit InteractableButton(GameObject& parent);
std::string GetTypeName() const override { return "InteractableButton"; }
void Start() override;
void Interact(GameObject& interactor) override;
nlohmann::json Serialize() const override;
void Deserialize(const nlohmann::json& data) override;
void ImGuiInspector() override;
[[nodiscard]] std::size_t GetColorIndex() const { return m_ColorIndex; }
[[nodiscard]] int GetPressCount() const { return m_PressCount; }
private:
void ApplyColor();
std::size_t m_ColorIndex{0};
int m_PressCount{0};
};
#endif // LIGHTKEEPER_INTERACTABLEBUTTON_H