9#include <unordered_set>
14#include "misc/Globals.h"
15#include "misc/Error.h"
73 static std::unique_ptr<World>
96 const std::filesystem::path& pathToNodeTree,
Definition: GameManager.h:34
static constexpr size_t getDefaultWorldSize()
Definition: Globals.h:33
void destroyWorld()
Definition: World.cpp:123
std::pair< std::recursive_mutex, std::unordered_map< size_t, Node * > > mtxSpawnedNodes
Definition: World.h:262
static std::variant< std::unique_ptr< World >, Error > loadNodeTreeAsWorld(GameManager *pGameManager, const std::filesystem::path &pathToNodeTree, size_t iWorldSize=Globals::getDefaultWorldSize())
Definition: World.cpp:77
sgc::GcPtr< Node > getRootNode()
Definition: World.cpp:94
float getWorldTimeInSeconds() const
Definition: World.cpp:106
void addNodeToCalledEveryFrameArrays(Node *pNode)
Definition: World.cpp:352
std::atomic< size_t > iTotalSpawnedNodeCount
Definition: World.h:265
const size_t iWorldSize
Definition: World.h:268
std::chrono::steady_clock::time_point timeWhenWorldCreated
Definition: World.h:271
CalledEveryFrameNodes * getCalledEveryFrameNodes()
Definition: World.cpp:143
~World()
Definition: World.cpp:47
void onNodeSpawned(Node *pNode)
Definition: World.cpp:149
void onNodeDespawned(Node *pNode)
Definition: World.cpp:201
std::pair< std::recursive_mutex, std::unordered_set< Node * > > * getReceivingInputNodes()
Definition: World.cpp:145
size_t getCalledEveryFrameNodeCount()
Definition: World.cpp:99
void onSpawnedNodeChangedIsReceivingInput(Node *pNode)
Definition: World.cpp:300
CalledEveryFrameNodes calledEveryFrameNodes
Definition: World.h:256
void addNodeToReceivingInputArray(Node *pNode)
Definition: World.cpp:346
size_t getTotalSpawnedNodeCount()
Definition: World.cpp:92
std::pair< std::recursive_mutex, bool > mtxIsDestroyed
Definition: World.h:250
void removeNodeFromReceivingInputArray(Node *pNode)
Definition: World.cpp:395
void removeNodeFromCalledEveryFrameArrays(Node *pNode)
Definition: World.cpp:366
GameManager * pGameManager
Definition: World.h:247
bool isNodeSpawned(size_t iNodeId)
Definition: World.cpp:115
void onSpawnedNodeChangedIsCalledEveryFrame(Node *pNode)
Definition: World.cpp:254
std::pair< std::recursive_mutex, std::unordered_set< Node * > > mtxReceivingInputNodes
Definition: World.h:259
std::pair< std::mutex, sgc::GcPtr< Node > > mtxRootNode
Definition: World.h:253
size_t getWorldSize() const
Definition: World.cpp:113
static std::unique_ptr< World > createWorld(GameManager *pGameManager, size_t iWorldSize=Globals::getDefaultWorldSize())
Definition: World.cpp:73
std::pair< std::recursive_mutex, std::unordered_set< Node * > > mtxFirstTickGroup
Definition: World.h:32
std::pair< std::recursive_mutex, std::unordered_set< Node * > > mtxSecondTickGroup
Definition: World.h:35