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 
14 // List of currencies
15 enum class CurrencyType : uint8_t
16 {
17     Pounds,       // British Pound
18     Dollars,      // US Dollar
19     Franc,        // French Franc
20     DeutscheMark, // Deutsche Mark
21     Yen,          // Japanese Yen
22     Peseta,       // Spanish Peseta
23     Lira,         // Italian Lira
24     Guilders,     // Dutch Gilder
25     Krona,        // Swedish Krona
26     Euros,        // Euro
27     Won,          // South Korean Won
28     Rouble,       // Russian Rouble
29     CzechKoruna,  // Czech koruna
30     HKD,          // Hong Kong Dollar
31     TWD,          // New Taiwan Dollar
32     Yuan,         // Chinese Yuan
33     Forint,       // Hungarian Forint
34 
35     Custom, // Custom currency
36 
37     Count // Last item
38 };
39 
40 enum class CurrencyAffix
41 {
42     Prefix,
43     Suffix
44 };
45 
46 #define CURRENCY_SYMBOL_MAX_SIZE 8
47 #define CURRENCY_RATE_MAX_NUM_DIGITS 9
48 
49 // Currency format specification - inspired by OpenTTD
50 struct currency_descriptor
51 {
52     char isoCode[4];
53     // Rate is relative to 0.10 GBP
54     int32_t rate;
55     CurrencyAffix affix_unicode;
56     utf8 symbol_unicode[CURRENCY_SYMBOL_MAX_SIZE];
57     CurrencyAffix affix_ascii;
58     char symbol_ascii[CURRENCY_SYMBOL_MAX_SIZE];
59     rct_string_id stringId;
60 };
61 
62 // List of currency formats
63 extern currency_descriptor CurrencyDescriptors[static_cast<uint8_t>(CurrencyType::Count)];
64 
65 /**
66  * Loads custom currency saved parameters into {@link CurrencyDescriptors}'
67  * custom currency entry
68  */
69 void currency_load_custom_currency_config();
70