summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemCookedFish.h
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2020-04-04 17:13:41 +0200
committerGitHub <noreply@github.com>2020-04-04 17:13:41 +0200
commit2b9474f171a4c0e1863b52ea585f145ddaabe404 (patch)
treecadb7c58b7b6f7b10182740b3afe87c1ad7354f1 /src/Items/ItemCookedFish.h
parentPotion changes (#4601) (diff)
downloadcuberite-2b9474f171a4c0e1863b52ea585f145ddaabe404.tar
cuberite-2b9474f171a4c0e1863b52ea585f145ddaabe404.tar.gz
cuberite-2b9474f171a4c0e1863b52ea585f145ddaabe404.tar.bz2
cuberite-2b9474f171a4c0e1863b52ea585f145ddaabe404.tar.lz
cuberite-2b9474f171a4c0e1863b52ea585f145ddaabe404.tar.xz
cuberite-2b9474f171a4c0e1863b52ea585f145ddaabe404.tar.zst
cuberite-2b9474f171a4c0e1863b52ea585f145ddaabe404.zip
Diffstat (limited to '')
-rw-r--r--src/Items/ItemCookedFish.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/Items/ItemCookedFish.h b/src/Items/ItemCookedFish.h
new file mode 100644
index 000000000..8a819c6f6
--- /dev/null
+++ b/src/Items/ItemCookedFish.h
@@ -0,0 +1,37 @@
+
+#pragma once
+
+#include "ItemFood.h"
+
+
+
+
+
+class cItemCookedFishHandler :
+ public cItemFoodHandler
+{
+ typedef cItemFoodHandler super;
+
+public:
+ cItemCookedFishHandler()
+ : super(E_ITEM_COOKED_FISH, FoodInfo(0, 0))
+ {
+ }
+
+ virtual FoodInfo GetFoodInfo(const cItem * a_Item) override
+ {
+ static const FoodInfo CookedFishInfos[] =
+ {
+ FoodInfo(5, 6.0), // Cooked fish
+ FoodInfo(6, 9.6), // Cooked salmon
+ };
+
+ if (a_Item->m_ItemDamage >= static_cast<short>(ARRAYCOUNT(CookedFishInfos)))
+ {
+ LOGWARNING("Unknown cooked fish type '%d'", a_Item->m_ItemDamage);
+ return FoodInfo(0, 0);
+ }
+ return CookedFishInfos[a_Item->m_ItemDamage];
+ }
+
+};