summaryrefslogtreecommitdiffstats
path: root/source/Items/ItemFood.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-07-29 09:57:34 +0200
committermadmaxoft <github@xoft.cz>2013-07-29 09:57:34 +0200
commit5530178aad3fa1a3061962d47d77b627ab5ceae3 (patch)
tree61ee7896061b4ef92877c120d9f5e917a6c5c924 /source/Items/ItemFood.h
parentMerge pull request #15 from mc-server/webadmin (diff)
parentUpdated the automatic Lua bindings (diff)
downloadcuberite-5530178aad3fa1a3061962d47d77b627ab5ceae3.tar
cuberite-5530178aad3fa1a3061962d47d77b627ab5ceae3.tar.gz
cuberite-5530178aad3fa1a3061962d47d77b627ab5ceae3.tar.bz2
cuberite-5530178aad3fa1a3061962d47d77b627ab5ceae3.tar.lz
cuberite-5530178aad3fa1a3061962d47d77b627ab5ceae3.tar.xz
cuberite-5530178aad3fa1a3061962d47d77b627ab5ceae3.tar.zst
cuberite-5530178aad3fa1a3061962d47d77b627ab5ceae3.zip
Diffstat (limited to 'source/Items/ItemFood.h')
-rw-r--r--source/Items/ItemFood.h66
1 files changed, 33 insertions, 33 deletions
diff --git a/source/Items/ItemFood.h b/source/Items/ItemFood.h
index d4c0a012a..4ec2f7a36 100644
--- a/source/Items/ItemFood.h
+++ b/source/Items/ItemFood.h
@@ -4,53 +4,53 @@
#include "ItemHandler.h"
-class cItemFoodHandler : public cItemHandler
+
+
+
+class cItemFoodHandler :
+ public cItemHandler
{
+ typedef cItemHandler super;
+
public:
cItemFoodHandler(int a_ItemType)
- : cItemHandler(a_ItemType)
+ : super(a_ItemType)
{
}
- virtual bool IsFood() override
+
+ virtual bool IsFood(void) override
{
return true;
}
- virtual FoodInfo GetFoodInfo() override
+
+ virtual FoodInfo GetFoodInfo(void) override
{
switch(m_ItemType)
{
- 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_PORKCHOP:
- return FoodInfo(3, 1.8f);
- case E_ITEM_STEAK:
- case E_ITEM_COOKED_PORKCHOP:
- 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);
+ case E_ITEM_BREAD: return FoodInfo(5, 6);
+ case E_ITEM_COOKIE: return FoodInfo(2, 0.4);
+ case E_ITEM_MELON_SLICE: return FoodInfo(2, 1.2);
+ case E_ITEM_RAW_CHICKEN: return FoodInfo(2, 1.2, 30);
+ case E_ITEM_COOKED_CHICKEN: return FoodInfo(6, 7.2);
+ case E_ITEM_RAW_BEEF: return FoodInfo(3, 1.8);
+ case E_ITEM_RAW_PORKCHOP: return FoodInfo(3, 1.8);
+ case E_ITEM_STEAK: return FoodInfo(8, 12.8);
+ case E_ITEM_COOKED_PORKCHOP: return FoodInfo(8, 12.8);
+ case E_ITEM_RAW_FISH: return FoodInfo(2, 1.2);
+ case E_ITEM_COOKED_FISH: return FoodInfo(5, 6);
+ case E_ITEM_RED_APPLE: return FoodInfo(4, 2.4);
+ case E_ITEM_GOLDEN_APPLE: return FoodInfo(4, 9.6);
+ case E_ITEM_ROTTEN_FLESH: return FoodInfo(4, 0.8, 80);
+ case E_ITEM_SPIDER_EYE: return FoodInfo(2, 3.2, 100);
}
+ LOGWARNING("%s: Unknown food item (%d), returning zero nutrition", __FUNCTION__, m_ItemType);
return FoodInfo(0, 0.f);
}
-}; \ No newline at end of file
+};
+
+
+
+