2022-10-31 22:32:07 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#ifndef __CONTROLBEHAVIORS__H__
|
|
|
|
#define __CONTROLBEHAVIORS__H__
|
|
|
|
|
2023-02-14 02:55:44 +00:00
|
|
|
#include <map>
|
2022-10-31 22:32:07 +00:00
|
|
|
#include <string>
|
|
|
|
|
2023-02-14 02:55:44 +00:00
|
|
|
#include "Singleton.h"
|
2022-10-31 22:32:07 +00:00
|
|
|
|
|
|
|
class AMFArrayValue;
|
2023-02-14 02:55:44 +00:00
|
|
|
class BlockDefinition;
|
|
|
|
class Entity;
|
2023-06-08 15:29:17 +00:00
|
|
|
class ModelBehaviorComponent;
|
2023-02-14 02:55:44 +00:00
|
|
|
class SystemAddress;
|
2022-10-31 22:32:07 +00:00
|
|
|
|
2023-02-14 02:55:44 +00:00
|
|
|
// Type definition to clarify what is used where
|
|
|
|
typedef std::string BlockName; //! A block name
|
|
|
|
|
|
|
|
class ControlBehaviors: public Singleton<ControlBehaviors> {
|
|
|
|
public:
|
|
|
|
ControlBehaviors();
|
2022-10-31 22:32:07 +00:00
|
|
|
/**
|
|
|
|
* @brief Main driver for processing Property Behavior commands
|
|
|
|
*
|
|
|
|
* @param modelEntity The model that sent this command
|
|
|
|
* @param sysAddr The SystemAddress to respond to
|
|
|
|
* @param arguments The arguments formatted as an AMFArrayValue
|
|
|
|
* @param command The command to perform
|
|
|
|
* @param modelOwner The owner of the model which sent this command
|
|
|
|
*/
|
|
|
|
void ProcessCommand(Entity* modelEntity, const SystemAddress& sysAddr, AMFArrayValue* arguments, std::string command, Entity* modelOwner);
|
2023-02-14 02:55:44 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Gets a blocks parameter values by the name
|
|
|
|
* No exception will be thrown in this function.
|
2023-06-08 15:29:17 +00:00
|
|
|
*
|
2023-02-14 02:55:44 +00:00
|
|
|
* @param blockName The block name to get the parameters of
|
2023-06-08 15:29:17 +00:00
|
|
|
*
|
2023-02-14 02:55:44 +00:00
|
|
|
* @return A pair of the block parameter name to its typing
|
|
|
|
*/
|
|
|
|
BlockDefinition* GetBlockInfo(const BlockName& blockName);
|
|
|
|
private:
|
2023-06-09 08:04:42 +00:00
|
|
|
void RequestUpdatedID(int32_t behaviorID, ModelBehaviorComponent* modelComponent, Entity* modelOwner, const SystemAddress& sysAddr);
|
2023-02-14 02:55:44 +00:00
|
|
|
void SendBehaviorListToClient(Entity* modelEntity, const SystemAddress& sysAddr, Entity* modelOwner);
|
2023-06-09 08:04:42 +00:00
|
|
|
void ModelTypeChanged(AMFArrayValue* arguments, ModelBehaviorComponent* ModelComponent);
|
2023-02-14 02:55:44 +00:00
|
|
|
void ToggleExecutionUpdates();
|
|
|
|
void AddStrip(AMFArrayValue* arguments);
|
|
|
|
void RemoveStrip(AMFArrayValue* arguments);
|
|
|
|
void MergeStrips(AMFArrayValue* arguments);
|
|
|
|
void SplitStrip(AMFArrayValue* arguments);
|
|
|
|
void UpdateStripUI(AMFArrayValue* arguments);
|
|
|
|
void AddAction(AMFArrayValue* arguments);
|
|
|
|
void MigrateActions(AMFArrayValue* arguments);
|
|
|
|
void RearrangeStrip(AMFArrayValue* arguments);
|
|
|
|
void Add(AMFArrayValue* arguments);
|
|
|
|
void RemoveActions(AMFArrayValue* arguments);
|
|
|
|
void Rename(Entity* modelEntity, const SystemAddress& sysAddr, Entity* modelOwner, AMFArrayValue* arguments);
|
2023-06-09 08:04:42 +00:00
|
|
|
void SendBehaviorBlocksToClient(ModelBehaviorComponent* modelComponent, const SystemAddress& sysAddr, Entity* modelOwner, AMFArrayValue* arguments);
|
2023-02-14 02:55:44 +00:00
|
|
|
void UpdateAction(AMFArrayValue* arguments);
|
2023-06-09 08:04:42 +00:00
|
|
|
void MoveToInventory(ModelBehaviorComponent* modelComponent, const SystemAddress& sysAddr, Entity* modelOwner, AMFArrayValue* arguments);
|
2023-02-14 02:55:44 +00:00
|
|
|
std::map<BlockName, BlockDefinition*> blockTypes{};
|
|
|
|
|
|
|
|
// If false, property behaviors will not be able to be edited.
|
|
|
|
bool isInitialized = false;
|
2022-10-31 22:32:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //!__CONTROLBEHAVIORS__H__
|