summaryrefslogtreecommitdiffstats
path: root/src/BlockInfo.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-06-26 15:56:44 +0200
committerHowaner <franzi.moos@googlemail.com>2014-06-26 15:56:44 +0200
commit9b7f1e3db87af8cb64d921b4b04d36e67a952c28 (patch)
treeb187f49105b7779d88c2336abc799facd66e25c8 /src/BlockInfo.h
parentOptimize combining. (diff)
parentMerge pull request #1126 from mc-server/BlockInfoInit (diff)
downloadcuberite-9b7f1e3db87af8cb64d921b4b04d36e67a952c28.tar
cuberite-9b7f1e3db87af8cb64d921b4b04d36e67a952c28.tar.gz
cuberite-9b7f1e3db87af8cb64d921b4b04d36e67a952c28.tar.bz2
cuberite-9b7f1e3db87af8cb64d921b4b04d36e67a952c28.tar.lz
cuberite-9b7f1e3db87af8cb64d921b4b04d36e67a952c28.tar.xz
cuberite-9b7f1e3db87af8cb64d921b4b04d36e67a952c28.tar.zst
cuberite-9b7f1e3db87af8cb64d921b4b04d36e67a952c28.zip
Diffstat (limited to 'src/BlockInfo.h')
-rw-r--r--src/BlockInfo.h23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/BlockInfo.h b/src/BlockInfo.h
index 40c1db867..d6d4e7430 100644
--- a/src/BlockInfo.h
+++ b/src/BlockInfo.h
@@ -16,18 +16,8 @@ class cBlockHandler;
class cBlockInfo
{
public:
- // tolua_end
-
- cBlockInfo();
-
- ~cBlockInfo();
-
- /** (Re-)Initializes the internal BlockInfo structures. */
- static void Initialize(void);
- // tolua_begin
-
- /** Returns the associated BlockInfo structure. */
+ /** Returns the associated BlockInfo structure for the specified block type. */
static cBlockInfo & Get(BLOCKTYPE a_Type);
@@ -79,13 +69,18 @@ public:
inline static cBlockHandler * GetHandler (BLOCKTYPE a_Type) { return Get(a_Type).m_Handler; }
-
protected:
+ /** Storage for all the BlockInfo structures. */
+ typedef cBlockInfo cBlockInfoArray[256];
- // TODO xdot: Change to std::vector to support dynamic block IDs
- static cBlockInfo ms_Info[256];
+ /** Creates a default BlockInfo structure, initializes all values to their defaults */
+ cBlockInfo();
+ /** Cleans up the stored values */
+ ~cBlockInfo();
+ /** Initializes the specified BlockInfo structures with block-specific values. */
+ static void Initialize(cBlockInfoArray & a_BlockInfos);
}; // tolua_export