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 From fff9e50109c53220b17a01bca8b422dcc066c07b Mon Sep 17 00:00:00 2001 From: worktycho Date: Sun, 12 Oct 2014 12:44:59 +0100 Subject: Aligned simulators --- src/World.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/World.h') diff --git a/src/World.h b/src/World.h index 66dd2494e..b2633d863 100644 --- a/src/World.h +++ b/src/World.h @@ -913,11 +913,11 @@ private: std::vector m_BlockTickQueue; std::vector m_BlockTickQueueCopy; // Second is for safely removing the objects from the queue - std::unique_ptr m_SimulatorManager; - std::unique_ptr m_SandSimulator; - cFluidSimulator * m_WaterSimulator; - cFluidSimulator * m_LavaSimulator; - std::unique_ptr m_FireSimulator; + std::unique_ptr m_SimulatorManager; + std::unique_ptr m_SandSimulator; + cFluidSimulator * m_WaterSimulator; + cFluidSimulator * m_LavaSimulator; + std::unique_ptr m_FireSimulator; cRedstoneSimulator * m_RedstoneSimulator; cCriticalSection m_CSPlayers; -- cgit v1.2.3 From 1eae7d0ece72b2a2644916e43bbf34edebb538c6 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Mon, 13 Oct 2014 10:34:33 +0200 Subject: Fixed style. --- src/World.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/World.h') diff --git a/src/World.h b/src/World.h index b2633d863..640aa8bc3 100644 --- a/src/World.h +++ b/src/World.h @@ -861,7 +861,8 @@ private: } }; - typedef std::list> cScheduledTasks; + typedef std::unique_ptr cScheduledTaskPtr; + typedef std::list cScheduledTasks; AString m_WorldName; -- cgit v1.2.3 From eeb580a74e48829908c303f8145802bfa1805c68 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Wed, 15 Oct 2014 19:01:55 +0200 Subject: Functions in cPluginManager get references instead of pointers. --- src/World.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/World.h') diff --git a/src/World.h b/src/World.h index 640aa8bc3..bb43d7fba 100644 --- a/src/World.h +++ b/src/World.h @@ -298,7 +298,7 @@ public: /** Queues a task to unload unused chunks onto the tick thread. The prefferred way of unloading*/ void QueueUnloadUnusedChunks(void); // tolua_export - void CollectPickupsByPlayer(cPlayer * a_Player); + void CollectPickupsByPlayer(cPlayer & a_Player); /** Adds the player to the world. Uses a queue to store the player object until the Tick thread processes the addition event. -- cgit v1.2.3