From 68cced73afe546328cf94ed07c57deee47bfadec Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 20 Sep 2020 14:50:52 +0100 Subject: BlockHandler initialisation is a constant expression (#4891) * BlockHandler initialisation is a constant expression If we can't make it all namespaces, this is the next best I guess. + Tag handlers constexpr, const as needed + Inherit constructors * Privatise handler functions * More constexpr Co-authored-by: Alexander Harkness --- src/BlockInfo.h | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'src/BlockInfo.h') diff --git a/src/BlockInfo.h b/src/BlockInfo.h index 44e8b5d43..01b5557d4 100644 --- a/src/BlockInfo.h +++ b/src/BlockInfo.h @@ -5,12 +5,6 @@ -// fwd: -class cBlockHandler; - - - - // tolua_begin class cBlockInfo { @@ -54,9 +48,6 @@ public: /** 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. */ @@ -157,13 +148,3 @@ inline const cBlockInfo & cBlockInfo::Get(BLOCKTYPE a_Type) static const cBlockInfoArray ms_Info; return ms_Info[a_Type]; } - - - - - -// Shortcut to get the blockhandler for a specific block -inline cBlockHandler * BlockHandler(BLOCKTYPE a_BlockType) -{ - return cBlockInfo::GetHandler(a_BlockType); -} -- cgit v1.2.3