2023-02-14 02:55:44 +00:00
|
|
|
#ifndef __BEHAVIORMESSAGEBASE__H__
|
|
|
|
#define __BEHAVIORMESSAGEBASE__H__
|
|
|
|
|
|
|
|
#include <stdexcept>
|
|
|
|
#include <string>
|
|
|
|
|
2023-05-13 22:22:00 +00:00
|
|
|
#include "Amf3.h"
|
2023-02-14 02:55:44 +00:00
|
|
|
#include "dCommonVars.h"
|
|
|
|
|
2023-02-16 17:30:33 +00:00
|
|
|
enum class BehaviorState : uint32_t;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief The behaviorID target of this ControlBehaviors message
|
|
|
|
*
|
|
|
|
*/
|
2023-02-14 02:55:44 +00:00
|
|
|
class BehaviorMessageBase {
|
|
|
|
public:
|
2024-01-03 13:34:38 +00:00
|
|
|
static inline int32_t DefaultBehaviorId = -1;
|
|
|
|
const int32_t GetBehaviorId() const { return behaviorId; };
|
|
|
|
bool IsDefaultBehaviorId() { return behaviorId == DefaultBehaviorId; };
|
2023-02-16 17:30:33 +00:00
|
|
|
BehaviorMessageBase(AMFArrayValue* arguments);
|
2024-01-03 13:34:38 +00:00
|
|
|
protected:
|
2023-02-16 17:30:33 +00:00
|
|
|
int32_t GetBehaviorIdFromArgument(AMFArrayValue* arguments);
|
2024-01-03 13:34:38 +00:00
|
|
|
int32_t GetActionIndexFromArgument(AMFArrayValue* arguments, const std::string& keyName = "actionIndex");
|
|
|
|
int32_t behaviorId = DefaultBehaviorId;
|
2023-02-14 02:55:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //!__BEHAVIORMESSAGEBASE__H__
|