3 #include "Mountain/core.hpp" 5 #include <magic_enum/magic_enum.hpp> 7 #include "Mountain/scene/component/component.hpp" 22 template <Concepts::EnumT T>
27 using UnderlyingType = Meta::UnderlyingEnumType<T>;
29 bool_t locked =
false;
31 using Component::operator=;
49 void Update()
override;
56 UnderlyingType GetStateIntegral()
const;
58 void SetState(
T newState);
60 void ForceState(
T newState);
67 T GetPreviousState()
const;
70 UnderlyingType GetPreviousStateIntegral()
const;
74 bool_t GetStateChanged()
const;
82 using Array = std::array<U, magic_enum::enum_count<T>()>;
84 Array<Action> m_Begins;
85 Array<Action> m_Updates;
87 Array<CoroutineFunction<>> m_Coroutines;
91 T m_State =
static_cast<T>(0);
92 T m_PreviousState =
static_cast<T>(0);
93 bool_t m_StateChanged =
false;
97 #include "Mountain/scene/component/state_machine.inl" Represents a behavior that can be attached to an Entity.
Defines the Coroutine class.
std::function< Coroutine(Args...)> CoroutineFunction
Coroutine function prototype.
Wrapper around C++20 Coroutines.
Defines the Mountain::Concepts namespace which contains useful concepts used in the engine...
Contains all declarations of the Mountain Framework.