From 473c0425d374132c097045a84e03510bc8a7876b Mon Sep 17 00:00:00 2001 From: tycho Date: Fri, 10 Oct 2014 15:33:19 +0100 Subject: Moved a few objects to unique_ptr --- src/World.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/World.h') diff --git a/src/World.h b/src/World.h index 90dada259..66dd2494e 100644 --- a/src/World.h +++ b/src/World.h @@ -103,7 +103,7 @@ public: virtual void Run(cWorld & a_World) = 0; } ; - typedef std::vector cTasks; + typedef std::vector> cTasks; class cTaskSaveAllChunks : @@ -506,7 +506,7 @@ public: // tolua_end - inline cSimulatorManager * GetSimulatorManager(void) { return m_SimulatorManager; } + inline cSimulatorManager * GetSimulatorManager(void) { return m_SimulatorManager.get(); } inline cFluidSimulator * GetWaterSimulator(void) { return m_WaterSimulator; } inline cFluidSimulator * GetLavaSimulator (void) { return m_LavaSimulator; } @@ -671,7 +671,7 @@ public: void QueueSaveAllChunks(void); // tolua_export /** Queues a task onto the tick thread. The task object will be deleted once the task is finished */ - void QueueTask(cTask * a_Task); // Exported in ManualBindings.cpp + void QueueTask(std::unique_ptr a_Task); // Exported in ManualBindings.cpp /** Queues a task onto the tick thread, with the specified delay. The task object will be deleted once the task is finished */ @@ -764,7 +764,7 @@ public: cChunkGenerator & GetGenerator(void) { return m_Generator; } cWorldStorage & GetStorage (void) { return m_Storage; } - cChunkMap * GetChunkMap (void) { return m_ChunkMap; } + cChunkMap * GetChunkMap (void) { return m_ChunkMap.get(); } /** Sets the blockticking to start at the specified block. Only one blocktick per chunk may be set, second call overwrites the first call */ void SetNextBlockTick(int a_BlockX, int a_BlockY, int a_BlockZ); // tolua_export @@ -861,7 +861,7 @@ private: } }; - typedef std::list cScheduledTasks; + typedef std::list> cScheduledTasks; AString m_WorldName; @@ -913,11 +913,11 @@ private: std::vector m_BlockTickQueue; std::vector m_BlockTickQueueCopy; // Second is for safely removing the objects from the queue - cSimulatorManager * m_SimulatorManager; - cSandSimulator * m_SandSimulator; + std::unique_ptr m_SimulatorManager; + std::unique_ptr m_SandSimulator; cFluidSimulator * m_WaterSimulator; cFluidSimulator * m_LavaSimulator; - cFireSimulator * m_FireSimulator; + std::unique_ptr m_FireSimulator; cRedstoneSimulator * m_RedstoneSimulator; cCriticalSection m_CSPlayers; @@ -927,7 +927,7 @@ private: unsigned int m_MaxPlayers; - cChunkMap * m_ChunkMap; + std::unique_ptr m_ChunkMap; bool m_bAnimals; std::set m_AllowedMobs; -- cgit v1.2.3