From 748b121703fa28b10933f4432c09391e66179118 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 28 Mar 2021 14:40:57 +0100 Subject: Unify DoWithBlockEntity (#5168) + DoWith calls now broadcast the block entity and mark the chunk dirty + Add block entity change queue to synchronise BE updates with block updates * Fixed a few incorrect assertions about BE type - Remove manual overloads --- src/BlockType.h | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'src/BlockType.h') diff --git a/src/BlockType.h b/src/BlockType.h index f98d9db82..4814c5a68 100644 --- a/src/BlockType.h +++ b/src/BlockType.h @@ -1181,36 +1181,3 @@ extern AString ItemToFullString(const cItem & a_Item); extern cItem GetIniItemSet(cIniFile & a_IniFile, const char * a_Section, const char * a_Key, const char * a_Default); // tolua_end - - - - - -/** Base case for IsOneOf to handle empty template aguments. */ -template -bool IsOneOf(BLOCKTYPE a_BlockType) -{ - return false; -} - - -/** Returns true if a_BlockType is equal to any of the variadic template arguments. -Some example usage: -\code - IsOneOf<>(E_BLOCK_AIR) == false - IsOneOf(E_BLOCK_DIRT) == false - IsOneOf(E_BLOCK_DIRT) == true -\endcode -The implementation is ugly but it is equivalent to this C++17 fold expression: -\code - ((a_BlockType == Types) || ...) -\endcode -Just written to be valid without fold expressions or SFINAE. */ -template -bool IsOneOf(BLOCKTYPE a_BlockType) -{ - return ((a_BlockType == Head) || (IsOneOf(a_BlockType))); -} - - - -- cgit v1.2.3