summaryrefslogtreecommitdiffstats
path: root/source/Defines.h
diff options
context:
space:
mode:
authorlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-12-25 18:47:01 +0100
committerlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-12-25 18:47:01 +0100
commit62abd8f29bbaec6da00b277d0bf4ced54ccab921 (patch)
tree4921dcb6892e2c5be5e61aedc47a399743a1327f /source/Defines.h
parentRefactored both simulators (water and lava) to make them more flexible and easier to modify (diff)
downloadcuberite-62abd8f29bbaec6da00b277d0bf4ced54ccab921.tar
cuberite-62abd8f29bbaec6da00b277d0bf4ced54ccab921.tar.gz
cuberite-62abd8f29bbaec6da00b277d0bf4ced54ccab921.tar.bz2
cuberite-62abd8f29bbaec6da00b277d0bf4ced54ccab921.tar.lz
cuberite-62abd8f29bbaec6da00b277d0bf4ced54ccab921.tar.xz
cuberite-62abd8f29bbaec6da00b277d0bf4ced54ccab921.tar.zst
cuberite-62abd8f29bbaec6da00b277d0bf4ced54ccab921.zip
Diffstat (limited to '')
-rw-r--r--source/Defines.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/source/Defines.h b/source/Defines.h
index 838eb1340..fb76c5bc7 100644
--- a/source/Defines.h
+++ b/source/Defines.h
@@ -140,3 +140,35 @@ inline float GetSpecialSignf( float a_Val )
{
return (a_Val <= 0.f)?-1.f:1.f;
}
+
+
+
+namespace ItemCategory
+{
+ inline bool IsPickaxe(ENUM_ITEM_ID a_ItemID)
+ {
+ return a_ItemID == E_ITEM_WOODEN_PICKAXE
+ || a_ItemID == E_ITEM_STONE_PICKAXE
+ || a_ItemID == E_ITEM_IRON_PICKAXE
+ || a_ItemID == E_ITEM_GOLD_PICKAXE
+ || a_ItemID == E_ITEM_DIAMOND_PICKAXE;
+ }
+
+ inline bool IsAxe(ENUM_ITEM_ID a_ItemID)
+ {
+ return a_ItemID == E_ITEM_WOODEN_AXE
+ || a_ItemID == E_ITEM_STONE_AXE
+ || a_ItemID == E_ITEM_IRON_AXE
+ || a_ItemID == E_ITEM_GOLD_AXE
+ || a_ItemID == E_ITEM_DIAMOND_AXE;
+ }
+
+ inline bool IsSword(ENUM_ITEM_ID a_ItemID)
+ {
+ return a_ItemID == E_ITEM_WOODEN_SWORD
+ || a_ItemID == E_ITEM_STONE_SWORD
+ || a_ItemID == E_ITEM_IRON_SWORD
+ || a_ItemID == E_ITEM_GOLD_SWORD
+ || a_ItemID == E_ITEM_DIAMOND_SWORD;
+ }
+} \ No newline at end of file