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 static const int CF_NOEURO = 0;
00019 static const int CF_ISEURO = 1;
00020 static const uint NUM_CURRENCY = 29;
00021 static const int CUSTOM_CURRENCY_ID = NUM_CURRENCY - 1;
00022
00023 struct CurrencySpec {
00024 uint16 rate;
00025 char separator[8];
00026 Year to_euro;
00027 char prefix[16];
00028 char suffix[16];
00038 byte symbol_pos;
00039 StringID name;
00040 };
00041
00042
00043 extern CurrencySpec _currency_specs[NUM_CURRENCY];
00044
00045
00046 #define _custom_currency (_currency_specs[CUSTOM_CURRENCY_ID])
00047 #define _currency ((const CurrencySpec*)&_currency_specs[GetGameSettings().locale.currency])
00048
00049 uint GetMaskOfAllowedCurrencies();
00050 void CheckSwitchToEuro();
00051 void ResetCurrencies(bool preserve_custom = true);
00052 StringID *BuildCurrencyDropdown();
00053 byte GetNewgrfCurrencyIdConverted(byte grfcurr_id);
00054
00055 #endif