#ifndef LIGHTKEEPER_INTERACTABLEBUTTON_H #define LIGHTKEEPER_INTERACTABLEBUTTON_H #include #include #include #include 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; } void SetCycleColors(bool cycleColors) { m_CycleColors = cycleColors; } // Every Activatable on a target object is activated when the button is pressed void AddTarget(const GameObject& target); void RemoveTarget(ObjectId target); [[nodiscard]] const std::vector& GetTargets() const { return m_Targets; } private: void ApplyColor(); void ActivateTargets(GameObject& interactor); void DrawTargetsInspector(); std::size_t m_ColorIndex{0}; int m_PressCount{0}; bool m_CycleColors{true}; std::vector m_Targets; }; #endif // LIGHTKEEPER_INTERACTABLEBUTTON_H