diff options
author | andrew <xdotftw@gmail.com> | 2014-03-01 16:04:17 +0100 |
---|---|---|
committer | andrew <xdotftw@gmail.com> | 2014-03-01 16:04:17 +0100 |
commit | 5c5502be9e46a0a5d44b6994e8075e5588598912 (patch) | |
tree | 9f5c6d46b9ce39ea14822cf31ce074d8f7830a52 /src/BlockInfo.h | |
parent | Merge pull request #735 from xdot/master (diff) | |
download | cuberite-5c5502be9e46a0a5d44b6994e8075e5588598912.tar cuberite-5c5502be9e46a0a5d44b6994e8075e5588598912.tar.gz cuberite-5c5502be9e46a0a5d44b6994e8075e5588598912.tar.bz2 cuberite-5c5502be9e46a0a5d44b6994e8075e5588598912.tar.lz cuberite-5c5502be9e46a0a5d44b6994e8075e5588598912.tar.xz cuberite-5c5502be9e46a0a5d44b6994e8075e5588598912.tar.zst cuberite-5c5502be9e46a0a5d44b6994e8075e5588598912.zip |
Diffstat (limited to '')
-rw-r--r-- | src/BlockInfo.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/BlockInfo.h b/src/BlockInfo.h new file mode 100644 index 000000000..1e09b0df5 --- /dev/null +++ b/src/BlockInfo.h @@ -0,0 +1,54 @@ + +#pragma once + + + + + + +class BlockInfo +{ +public: + + BlockInfo(); + + /** (Re-)Initializes the internal BlockInfo structures. */ + static void Initialize(void); + + /** Returns the associated BlockInfo structure. */ + static BlockInfo & GetById(unsigned int a_ID); + + NIBBLETYPE m_LightValue; + NIBBLETYPE m_SpreadLightFalloff; + + bool m_Transparent; + bool m_OneHitDig; + bool m_PistonBreakable; + bool m_IsSnowable; + bool m_RequiresSpecialTool; + bool m_IsSolid; + bool m_FullyOccupiesVoxel; + + + inline static NIBBLETYPE GetLightValue (unsigned int a_ID) { return GetById(a_ID).m_LightValue; } + inline static NIBBLETYPE GetSpreadLightFalloff(unsigned int a_ID) { return GetById(a_ID).m_SpreadLightFalloff; } + inline static bool IsTransparent (unsigned int a_ID) { return GetById(a_ID).m_Transparent; } + inline static bool IsOneHitDig (unsigned int a_ID) { return GetById(a_ID).m_OneHitDig; } + inline static bool IsPistoneBreakable (unsigned int a_ID) { return GetById(a_ID).m_PistonBreakable; } + inline static bool IsSnowable (unsigned int a_ID) { return GetById(a_ID).m_IsSnowable; } + inline static bool RequiresSpecialTool (unsigned int a_ID) { return GetById(a_ID).m_RequiresSpecialTool; } + inline static bool IsSolid (unsigned int a_ID) { return GetById(a_ID).m_IsSolid; } + inline static bool FullyOccupiesVoxel (unsigned int a_ID) { return GetById(a_ID).m_FullyOccupiesVoxel; } + + +protected: + + // TODO xdot: Change to std::vector to support dynamic block IDs + static BlockInfo ms_Info[256]; + + +}; + + + + |