currency.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #ifndef CURRENCY_H
00013 #define CURRENCY_H
00014
00015 #include "date_type.h"
00016 #include "strings_type.h"
00017
00018 enum {
00019 CF_NOEURO = 0,
00020 CF_ISEURO = 1,
00021 NUM_CURRENCY = 29,
00022 CUSTOM_CURRENCY_ID = NUM_CURRENCY - 1
00023 };
00024
00025 struct CurrencySpec {
00026 uint16 rate;
00027 char separator[8];
00028 Year to_euro;
00029 char prefix[16];
00030 char suffix[16];
00040 byte symbol_pos;
00041 StringID name;
00042 };
00043
00044
00045 extern CurrencySpec _currency_specs[NUM_CURRENCY];
00046
00047
00048 #define _custom_currency (_currency_specs[CUSTOM_CURRENCY_ID])
00049 #define _currency ((const CurrencySpec*)&_currency_specs[_game_mode == GM_MENU ? _settings_newgame.locale.currency : _settings_game.locale.currency])
00050
00051 uint GetMaskOfAllowedCurrencies();
00052 void CheckSwitchToEuro();
00053 void ResetCurrencies(bool preserve_custom = true);
00054 StringID *BuildCurrencyDropdown();
00055 byte GetNewgrfCurrencyIdConverted(byte grfcurr_id);
00056
00057 #endif