Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/system/ComponentManager.h
Show All 40 Lines | class CComponentManager | ||||
NONCOPYABLE(CComponentManager); | NONCOPYABLE(CComponentManager); | ||||
public: | public: | ||||
// We can't use EInterfaceId/etc directly, since scripts dynamically generate new IDs | // We can't use EInterfaceId/etc directly, since scripts dynamically generate new IDs | ||||
// and casting arbitrary ints to enums is undefined behaviour, so use 'int' typedefs | // and casting arbitrary ints to enums is undefined behaviour, so use 'int' typedefs | ||||
typedef int InterfaceId; | typedef int InterfaceId; | ||||
typedef int ComponentTypeId; | typedef int ComponentTypeId; | ||||
typedef int MessageTypeId; | typedef int MessageTypeId; | ||||
// FIXME | |||||
template <typename funcPtr, funcPtr callable> | |||||
friend void ScriptWrapper::WrapAndRegister(const ScriptInterface& itf, const char* name); | |||||
private: | private: | ||||
// Component allocation types | // Component allocation types | ||||
typedef IComponent* (*AllocFunc)(const ScriptInterface& scriptInterface, JS::HandleValue ctor); | typedef IComponent* (*AllocFunc)(const ScriptInterface& scriptInterface, JS::HandleValue ctor); | ||||
typedef void (*DeallocFunc)(IComponent*); | typedef void (*DeallocFunc)(IComponent*); | ||||
// ComponentTypes come in three types: | // ComponentTypes come in three types: | ||||
// Native: normal C++ component | // Native: normal C++ component | ||||
// ScriptWrapper: C++ component that wraps a JS component implementation | // ScriptWrapper: C++ component that wraps a JS component implementation | ||||
▲ Show 20 Lines • Show All 287 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator