tron@2292: /* $Id$ */ tron@2292: tron@2291: #ifndef CURRENCY_H tron@2291: #define CURRENCY_H tron@2291: tron@2291: enum { tron@2291: CF_NOEURO = 0, tron@2291: CF_ISEURO = 1, Darkvater@5091: NUM_CURRENCY = 28, tron@4380: CUSTOM_CURRENCY_ID = NUM_CURRENCY - 1 tron@2291: }; tron@2291: tron@2291: typedef struct { tron@2291: uint16 rate; tron@2291: char separator; rubidium@4297: Year to_euro; tron@2291: char prefix[16]; tron@2291: char suffix[16]; belugas@4377: /** belugas@4602: * The currency symbol is represented by two possible values, prefix and suffix belugas@4602: * Usage of one or the other is determined by symbol_pos. belugas@4602: * 0 = prefix belugas@4602: * 1 = suffix belugas@4602: * 2 = both : Special case only for custom currency. belugas@4602: * It is not a spec from Newgrf, belugas@4602: * rather a way to let users do what they want with custom curency belugas@4377: */ belugas@4377: byte symbol_pos; belugas@4377: StringID name; tron@2291: } CurrencySpec; tron@2291: belugas@4377: belugas@4377: extern CurrencySpec _currency_specs[NUM_CURRENCY]; tron@2291: tron@2306: // XXX small hack, but makes the rest of the code a bit nicer to read peter1138@3596: #define _custom_currency (_currency_specs[CUSTOM_CURRENCY_ID]) tron@2468: #define _currency ((const CurrencySpec*)&_currency_specs[_opt_ptr->currency]) tron@2306: tron@2291: uint GetMaskOfAllowedCurrencies(void); tron@2306: void CheckSwitchToEuro(void); belugas@5480: void ResetCurrencies(bool preserve_custom); belugas@4377: StringID* BuildCurrencyDropdown(void); belugas@4625: byte GetNewgrfCurrencyIdConverted(byte grfcurr_id); tron@2291: Darkvater@2436: #endif /* CURRENCY_H */