summaryrefslogtreecommitdiffstats
path: root/source/Items/ItemFood.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-29 15:59:32 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-29 15:59:32 +0200
commit4df23d19b7be2f274974e3dfe91e716e6296f11c (patch)
tree144451e77d8363c4c4d15c4f634c30bdf0728131 /source/Items/ItemFood.h
parentExtended the cFile interface with Printf() (diff)
downloadcuberite-4df23d19b7be2f274974e3dfe91e716e6296f11c.tar
cuberite-4df23d19b7be2f274974e3dfe91e716e6296f11c.tar.gz
cuberite-4df23d19b7be2f274974e3dfe91e716e6296f11c.tar.bz2
cuberite-4df23d19b7be2f274974e3dfe91e716e6296f11c.tar.lz
cuberite-4df23d19b7be2f274974e3dfe91e716e6296f11c.tar.xz
cuberite-4df23d19b7be2f274974e3dfe91e716e6296f11c.tar.zst
cuberite-4df23d19b7be2f274974e3dfe91e716e6296f11c.zip
Diffstat (limited to 'source/Items/ItemFood.h')
-rw-r--r--source/Items/ItemFood.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/source/Items/ItemFood.h b/source/Items/ItemFood.h
new file mode 100644
index 000000000..6e5a27d5d
--- /dev/null
+++ b/source/Items/ItemFood.h
@@ -0,0 +1,56 @@
+
+#pragma once
+
+#include "ItemHandler.h"
+
+
+class cItemFoodHandler : public cItemHandler
+{
+public:
+ cItemFoodHandler(int a_ItemID)
+ : cItemHandler(a_ItemID)
+ {
+ }
+
+ virtual bool IsFood() override
+ {
+ return true;
+ }
+
+ virtual FoodInfo GetFoodInfo() override
+ {
+ switch(m_ItemID)
+ {
+ case E_ITEM_BREAD:
+ return FoodInfo(5, 6.f);
+ case E_ITEM_COOKIE:
+ return FoodInfo(2, 0.4f);
+ case E_ITEM_MELON_SLICE:
+ return FoodInfo(2, 1.2f);
+ case E_ITEM_RAW_CHICKEN:
+ return FoodInfo(2, 1.2f, 30);
+ case E_ITEM_COOKED_CHICKEN:
+ return FoodInfo(6, 7.2f);
+ case E_ITEM_RAW_BEEF:
+ case E_ITEM_RAW_MEAT:
+ return FoodInfo(3, 1.8f);
+ case E_ITEM_STEAK:
+ case E_ITEM_COOKED_MEAT:
+ return FoodInfo(8, 12.8f);
+ case E_ITEM_RAW_FISH:
+ return FoodInfo(2, 1.2f);
+ case E_ITEM_COOKED_FISH:
+ return FoodInfo(5, 6.f);
+ case E_ITEM_RED_APPLE:
+ return FoodInfo(4, 2.4f);
+ case E_ITEM_GOLDEN_APPLE:
+ return FoodInfo(4, 9.6f);
+ case E_ITEM_ROTTEN_FLESH:
+ return FoodInfo(4, 0.8f, 80);
+ case E_ITEM_SPIDER_EYE:
+ return FoodInfo(2, 3.2f, 100);
+ }
+ return FoodInfo(0, 0.f);
+ }
+
+}; \ No newline at end of file