summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemCookedFish.h
blob: d0edc2d6ae995fc70d21899df599e25ed04c3856 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

#pragma once

#include "ItemFood.h"





class cItemCookedFishHandler:
	public cItemFoodHandler
{
	using Super = cItemFoodHandler;

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];
	}

};