2023-02-16 17:30:33 +00:00
|
|
|
#ifndef __ACTIONCONTEXT__H__
|
|
|
|
#define __ACTIONCONTEXT__H__
|
|
|
|
|
|
|
|
#include "BehaviorStates.h"
|
|
|
|
#include "dCommonVars.h"
|
|
|
|
|
2024-11-19 02:45:24 +00:00
|
|
|
#include <string_view>
|
|
|
|
|
2023-02-16 17:30:33 +00:00
|
|
|
class AMFArrayValue;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Sent if contextual State and Strip informationis needed for a ControlBehaviors message
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
class ActionContext {
|
|
|
|
public:
|
2024-02-18 06:38:26 +00:00
|
|
|
ActionContext() noexcept = default;
|
2024-11-19 02:45:24 +00:00
|
|
|
ActionContext(const AMFArrayValue& arguments, const std::string_view customStateKey = "stateID", const std::string_view customStripKey = "stripID");
|
2024-02-18 06:38:26 +00:00
|
|
|
[[nodiscard]] StripId GetStripId() const noexcept { return m_StripId; };
|
|
|
|
[[nodiscard]] BehaviorState GetStateId() const noexcept { return m_StateId; };
|
|
|
|
|
2023-02-16 17:30:33 +00:00
|
|
|
private:
|
2024-11-19 02:45:24 +00:00
|
|
|
[[nodiscard]] BehaviorState GetBehaviorStateFromArgument(const AMFArrayValue& arguments, const std::string_view key) const;
|
|
|
|
[[nodiscard]] StripId GetStripIdFromArgument(const AMFArrayValue& arguments, const std::string_view key) const;
|
2024-02-18 06:38:26 +00:00
|
|
|
StripId m_StripId{ 0 };
|
|
|
|
BehaviorState m_StateId{ BehaviorState::HOME_STATE };
|
2023-02-16 17:30:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //!__ACTIONCONTEXT__H__
|