summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemFood.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2013-11-27 09:23:17 +0100
committerMattes D <github@xoft.cz>2013-11-27 09:23:17 +0100
commit49760db89d94ede5d123d927141a6cd60dbaaf07 (patch)
tree6c6cf99e4cf3128311a93cd187947b502f3732a0 /src/Items/ItemFood.h
parentcWorld::SpawnExperienceOrb() now returns the entity ID of the spawned orb. (diff)
parentFixed VC2008 compilation, normalized include paths. (diff)
downloadcuberite-49760db89d94ede5d123d927141a6cd60dbaaf07.tar
cuberite-49760db89d94ede5d123d927141a6cd60dbaaf07.tar.gz
cuberite-49760db89d94ede5d123d927141a6cd60dbaaf07.tar.bz2
cuberite-49760db89d94ede5d123d927141a6cd60dbaaf07.tar.lz
cuberite-49760db89d94ede5d123d927141a6cd60dbaaf07.tar.xz
cuberite-49760db89d94ede5d123d927141a6cd60dbaaf07.tar.zst
cuberite-49760db89d94ede5d123d927141a6cd60dbaaf07.zip
Diffstat (limited to 'src/Items/ItemFood.h')
-rw-r--r--src/Items/ItemFood.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/Items/ItemFood.h b/src/Items/ItemFood.h
new file mode 100644
index 000000000..2ae572331
--- /dev/null
+++ b/src/Items/ItemFood.h
@@ -0,0 +1,63 @@
+#pragma once
+
+#include "ItemHandler.h"
+
+
+
+
+
+class cItemFoodHandler :
+ public cItemHandler
+{
+ typedef cItemHandler super;
+
+public:
+ cItemFoodHandler(int a_ItemType)
+ : super(a_ItemType)
+ {
+ }
+
+
+ virtual bool IsFood(void) override
+ {
+ return true;
+ }
+
+
+ virtual FoodInfo GetFoodInfo(void) override
+ {
+ switch(m_ItemType)
+ {
+ // Please keep alpha-sorted.
+ case E_ITEM_BAKED_POTATO: return FoodInfo(6, 7.2);
+ case E_ITEM_BREAD: return FoodInfo(5, 6);
+ case E_ITEM_CARROT: return FoodInfo(4, 4.8);
+ case E_ITEM_COOKED_CHICKEN: return FoodInfo(6, 7.2);
+ case E_ITEM_COOKED_FISH: return FoodInfo(5, 6);
+ case E_ITEM_COOKED_PORKCHOP: return FoodInfo(8, 12.8);
+ case E_ITEM_COOKIE: return FoodInfo(2, 0.4);
+ case E_ITEM_GOLDEN_APPLE: return FoodInfo(4, 9.6);
+ case E_ITEM_GOLDEN_CARROT: return FoodInfo(6, 14.4);
+ case E_ITEM_MELON_SLICE: return FoodInfo(2, 1.2);
+ case E_ITEM_POISONOUS_POTATO: return FoodInfo(2, 1.2, 60);
+ case E_ITEM_POTATO: return FoodInfo(1, 0.6);
+ case E_ITEM_PUMPKIN_PIE: return FoodInfo(8, 4.8);
+ case E_ITEM_RAW_BEEF: return FoodInfo(3, 1.8);
+ case E_ITEM_RAW_CHICKEN: return FoodInfo(2, 1.2, 30);
+ case E_ITEM_RAW_FISH: return FoodInfo(2, 1.2);
+ case E_ITEM_RAW_PORKCHOP: return FoodInfo(3, 1.8);
+ case E_ITEM_RED_APPLE: return FoodInfo(4, 2.4);
+ case E_ITEM_ROTTEN_FLESH: return FoodInfo(4, 0.8, 80);
+ case E_ITEM_SPIDER_EYE: return FoodInfo(2, 3.2, 100);
+ case E_ITEM_STEAK: return FoodInfo(8, 12.8);
+ case E_ITEM_MUSHROOM_SOUP: return FoodInfo(6, 7.2);
+ }
+ LOGWARNING("%s: Unknown food item (%d), returning zero nutrition", __FUNCTION__, m_ItemType);
+ return FoodInfo(0, 0.f);
+ }
+
+};
+
+
+
+