currency.h

Go to the documentation of this file.
00001 /* $Id: currency.h 15718 2009-03-15 00:32:18Z rubidium $ */
00002 
00005 #ifndef CURRENCY_H
00006 #define CURRENCY_H
00007 
00008 #include "date_type.h"
00009 #include "strings_type.h"
00010 
00011 enum {
00012   CF_NOEURO = 0,
00013   CF_ISEURO = 1,
00014   NUM_CURRENCY = 29,
00015   CUSTOM_CURRENCY_ID = NUM_CURRENCY - 1
00016 };
00017 
00018 struct CurrencySpec {
00019   uint16 rate;
00020   char separator;
00021   Year to_euro;
00022   char prefix[16];
00023   char suffix[16];
00033   byte symbol_pos;
00034   StringID name;
00035 };
00036 
00037 
00038 extern CurrencySpec _currency_specs[NUM_CURRENCY];
00039 
00040 /* XXX small hack, but makes the rest of the code a bit nicer to read */
00041 #define _custom_currency (_currency_specs[CUSTOM_CURRENCY_ID])
00042 #define _currency ((const CurrencySpec*)&_currency_specs[_game_mode == GM_MENU ? _settings_newgame.locale.currency : _settings_game.locale.currency])
00043 
00044 uint GetMaskOfAllowedCurrencies();
00045 void CheckSwitchToEuro();
00046 void ResetCurrencies(bool preserve_custom = true);
00047 StringID *BuildCurrencyDropdown();
00048 byte GetNewgrfCurrencyIdConverted(byte grfcurr_id);
00049 
00050 #endif /* CURRENCY_H */

Generated on Wed Apr 1 14:38:05 2009 for OpenTTD by  doxygen 1.5.6