1 /*****************************************************************************
2  * Copyright (c) 2014-2020 OpenRCT2 developers
3  *
4  * For a complete list of all authors, please refer to contributors.md
5  * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
6  *
7  * OpenRCT2 is licensed under the GNU General Public License version 3.
8  *****************************************************************************/
9 
10 #pragma once
11 
12 #include "../common.h"
13 #include "../util/Util.h"
14 #include "../world/Litter.h"
15 
16 struct Ride;
17 enum class PeepThoughtType : uint8_t;
18 
19 enum class ShopItem : uint8_t
20 {
21     Balloon,
22     Toy,
23     Map,
24     Photo,
25     Umbrella,
26     Drink,
27     Burger,
28     Chips,
29     IceCream,
30     Candyfloss,
31     EmptyCan,
32     Rubbish,
33     EmptyBurgerBox,
34     Pizza,
35     Voucher,
36     Popcorn,
37     HotDog,
38     Tentacle,
39     Hat,
40     ToffeeApple,
41     TShirt,
42     Doughnut,
43     Coffee,
44     EmptyCup,
45     Chicken,
46     Lemonade,
47     EmptyBox,
48     EmptyBottle = 27,
49     Admission = 31,
50     Photo2 = 32,
51     Photo3,
52     Photo4,
53     Pretzel,
54     Chocolate,
55     IcedTea,
56     FunnelCake,
57     Sunglasses,
58     BeefNoodles,
59     FriedRiceNoodles,
60     WontonSoup,
61     MeatballSoup,
62     FruitJuice,
63     SoybeanMilk,
64     Sujeonggwa,
65     SubSandwich,
66     Cookie,
67     EmptyBowlRed,
68     EmptyDrinkCarton,
69     EmptyJuiceCup,
70     RoastSausage,
71     EmptyBowlBlue,
72     Count = 56,
73     None = 255
74 };
75 
76 ShopItem& operator++(ShopItem& d, int);
77 
78 using ShopItemIndex = ShopItem;
79 
80 struct ShopItemStrings
81 {
82     rct_string_id PriceLabel; // Balloon price:
83     rct_string_id Singular;   // Balloon
84     rct_string_id Plural;     // Balloons
85     rct_string_id Indefinite; // a Balloon
86     rct_string_id Display;    // "Diamond Heights" Balloon
87 };
88 
89 struct ShopItemDescriptor
90 {
91     money16 Cost;
92     money16 BaseValue;
93     money16 HotValue;
94     money16 ColdValue;
95     money8 DefaultPrice;
96     uint32_t Image;
97     ShopItemStrings Naming;
98     uint16_t Flags;
99     Litter::Type Type;
100     uint8_t ConsumptionTime;
101     ShopItem DiscardContainer;
102     PeepThoughtType TooMuchThought;
103     PeepThoughtType GoodValueThought;
104 
HasFlagShopItemDescriptor105     constexpr bool HasFlag(const uint16_t flag) const
106     {
107         return (Flags & flag) != 0;
108     }
109     bool IsFood() const;
110     bool IsDrink() const;
111     bool IsFoodOrDrink() const;
112     bool IsSouvenir() const;
113     bool IsPhoto() const;
114 };
115 
116 uint64_t ShopItemsGetAllFoods();
117 uint64_t ShopItemsGetAllDrinks();
118 uint64_t ShopItemsGetAllContainers();
119 
120 enum
121 {
122     SHOP_ITEM_FLAG_IS_FOOD = (1 << 0),
123     SHOP_ITEM_FLAG_IS_DRINK = (1 << 1),
124     SHOP_ITEM_FLAG_IS_SOUVENIR = (1 << 2),
125     SHOP_ITEM_FLAG_IS_PHOTO = (1 << 3),
126     SHOP_ITEM_FLAG_IS_CONTAINER = (1 << 4),
127 };
128 
129 extern uint64_t gSamePriceThroughoutPark;
130 
131 money32 shop_item_get_common_price(Ride* forRide, const ShopItem shopItem);
132 bool shop_item_has_common_price(const ShopItem shopItem);
133 
134 const ShopItemDescriptor& GetShopItemDescriptor(ShopItem item);
135