diff options
author | Alexander Harkness <me@bearbin.net> | 2020-04-04 17:13:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-04 17:13:41 +0200 |
commit | 2b9474f171a4c0e1863b52ea585f145ddaabe404 (patch) | |
tree | cadb7c58b7b6f7b10182740b3afe87c1ad7354f1 /src/Items/ItemCookedFish.h | |
parent | Potion changes (#4601) (diff) | |
download | cuberite-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 'src/Items/ItemCookedFish.h')
-rw-r--r-- | src/Items/ItemCookedFish.h | 37 |
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]; + } + +}; |