src/currency.h
changeset 5726 8f399788f6c9
parent 5091 fe51b6c9ed6c
child 6268 4b5241e5dd10
equal deleted inserted replaced
5725:8ad0e96437e0 5726:8f399788f6c9
       
     1 /* $Id$ */
       
     2 
       
     3 #ifndef CURRENCY_H
       
     4 #define CURRENCY_H
       
     5 
       
     6 enum {
       
     7 	CF_NOEURO = 0,
       
     8 	CF_ISEURO = 1,
       
     9 	NUM_CURRENCY = 28,
       
    10 	CUSTOM_CURRENCY_ID = NUM_CURRENCY - 1
       
    11 };
       
    12 
       
    13 typedef struct {
       
    14 	uint16 rate;
       
    15 	char separator;
       
    16 	Year to_euro;
       
    17 	char prefix[16];
       
    18 	char suffix[16];
       
    19 	/**
       
    20 	 * The currency symbol is represented by two possible values, prefix and suffix
       
    21 	 * Usage of one or the other is determined by symbol_pos.
       
    22 	 * 0 = prefix
       
    23 	 * 1 = suffix
       
    24 	 * 2 = both : Special case only for custom currency.
       
    25 	 *            It is not a spec from Newgrf,
       
    26 	 *            rather a way to let users do what they want with custom curency
       
    27 	 */
       
    28 	byte symbol_pos;
       
    29 	StringID name;
       
    30 } CurrencySpec;
       
    31 
       
    32 
       
    33 extern CurrencySpec _currency_specs[NUM_CURRENCY];
       
    34 
       
    35 // XXX small hack, but makes the rest of the code a bit nicer to read
       
    36 #define _custom_currency (_currency_specs[CUSTOM_CURRENCY_ID])
       
    37 #define _currency ((const CurrencySpec*)&_currency_specs[_opt_ptr->currency])
       
    38 
       
    39 uint GetMaskOfAllowedCurrencies(void);
       
    40 void CheckSwitchToEuro(void);
       
    41 void ResetCurrencies(void);
       
    42 StringID* BuildCurrencyDropdown(void);
       
    43 byte GetNewgrfCurrencyIdConverted(byte grfcurr_id);
       
    44 
       
    45 #endif /* CURRENCY_H */