3#include <Core/World/Declarations.h>
4#include <Foundation/Configuration/Startup.h>
5#include <Foundation/Strings/HashedString.h>
22 const plWorld* GetWorld()
const;
25 plUInt32 GetWorldIndex()
const;
34 plUInt32 m_uiFirstComponentIndex = 0;
35 plUInt32 m_uiComponentCount = 0;
46 using StorageType = plUInt8;
61 : m_Function(function)
63 m_sFunctionName.Assign(sFunctionName);
73 bool m_bOnlyUpdateWhenSimulating =
false;
74 plUInt16 m_uiGranularity = 0;
76 float m_fPriority = 0.0f;
93 bool GetWorldSimulationEnabled()
const;
121 template <
typename ModuleType,
typename RTTIType>
122 plWorldModuleTypeId RegisterWorldModule();
125 plWorldModuleTypeId GetTypeId(
const plRTTI* pRtti);
137 PL_MAKE_SUBSYSTEM_STARTUP_FRIEND(Core, WorldModuleFactory);
142 plWorldModuleTypeId RegisterWorldModule(
const plRTTI* pRtti, CreatorFunc creatorFunc);
144 static void PluginEventHandler(
const plPluginEvent& EventData);
145 void FillBaseTypeIds();
146 void ClearUnloadedTypeToIDs();
147 void AdjustBaseTypeId(
const plRTTI* pParentRtti,
const plRTTI* pRtti, plUInt16 uiParentTypeId);
151 struct CreatorFuncContext
153 PL_DECLARE_POD_TYPE();
165#define PL_DECLARE_WORLD_MODULE() \
167 static PL_ALWAYS_INLINE plWorldModuleTypeId TypeId() { return s_TypeId; } \
170 static plWorldModuleTypeId s_TypeId;
173#define PL_IMPLEMENT_WORLD_MODULE(moduleType) \
174 plWorldModuleTypeId moduleType::s_TypeId = plWorldModuleFactory::GetInstance()->RegisterWorldModule<moduleType, moduleType>();
177#define PL_CREATE_MODULE_UPDATE_FUNCTION_DESC(func, instance) plWorldModule::UpdateFunctionDesc(plWorldModule::UpdateFunction(&func, instance), #func)
179#include <Core/World/Implementation/WorldModule_inl.h>
Base class for all memory allocators.
Definition Allocator.h:23
Definition DynamicArray.h:81
Definition HashTable.h:333
This class is optimized to take nearly no memory (sizeof(void*)) and to allow very fast checks whethe...
Definition HashedString.h:25
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
Definition WorldData.h:18
This class provides functions to work on raw memory.
Definition MemoryUtils.h:26
This class holds information about reflected types. Each instance represents one type that is known t...
Definition RTTI.h:30
All classes that should be dynamically reflectable, need to be derived from this base class.
Definition DynamicRTTI.h:86
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
A world encapsulates a scene graph of game objects and various component managers and their component...
Definition World.h:22
Helper class to get component type ids and create new instances of world modules from rtti.
Definition WorldModule.h:117
Definition WorldModule.h:10
virtual void OnSimulationStarted()
This method is called at the start of the next world update when the world is simulated....
Definition WorldModule.h:105
virtual void Initialize()
This method is called after the constructor. A derived type can override this method to do initializa...
Definition WorldModule.h:98
virtual void Deinitialize()
This method is called before the destructor. A derived type can override this method to do deinitiali...
Definition WorldModule.h:101
virtual void WorldClear()
Called by plWorld::Clear(). Can be used to clear cached data when a world is completely cleared of ob...
Definition WorldModule.h:108
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
The data that is broadcast whenever a plugin is (un-) loaded.
Definition Plugin.h:11
Definition WorldModule.h:33
Definition WorldModule.h:45
Description of an update function that can be registered at the world.
Definition WorldModule.h:43
plHybridArray< plHashedString, 4 > m_DependsOn
Definition WorldModule.h:69
plHashedString m_sFunctionName
Definition WorldModule.h:67
UpdateFunction m_Function
Delegate to the actual update function.
Definition WorldModule.h:66
plEnum< Phase > m_Phase
Definition WorldModule.h:71