From c3d2956ba588a4559fabc36a0c1fc7dd28279314 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Thu, 17 Sep 2020 14:51:42 +0100 Subject: BlockHandler: no dynamic allocation (#4862) * BlockHandler: no dynamic allocation --- src/BlockInfo.h | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/BlockInfo.h') diff --git a/src/BlockInfo.h b/src/BlockInfo.h index 5992db9d9..44e8b5d43 100644 --- a/src/BlockInfo.h +++ b/src/BlockInfo.h @@ -51,13 +51,14 @@ public: See Physics\Explodinator.cpp for details of explosion block destruction. */ static float GetExplosionAbsorption(BLOCKTYPE Block); - inline static cBlockHandler * GetHandler (BLOCKTYPE a_Type) { return Get(a_Type).m_Handler.get(); } - /** Creates a default BlockInfo structure, initializes all values to their defaults */ cBlockInfo(); + /** Gets the blockhandler for the given block type. */ + static cBlockHandler * GetHandler(BLOCKTYPE a_Type); private: + /** Storage for all the BlockInfo structures. */ class cBlockInfoArray; @@ -99,15 +100,6 @@ private: /** Block's hardness. The greater the value the longer the player needs to break the block. */ float m_Hardness; - - /** Custom deleter allows cBlockHandler to be an incomplete type. */ - struct sHandlerDeleter - { - void operator () (cBlockHandler * a_Handler); - }; - - /** Associated block handler. */ - std::unique_ptr m_Handler; }; // tolua_export -- cgit v1.2.3