OpenTTD
currency.h
Go to the documentation of this file.
1 /* $Id: currency.h 25076 2013-03-09 16:31:56Z planetmaker $ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8  */
9 
12 #ifndef CURRENCY_H
13 #define CURRENCY_H
14 
15 #include "date_type.h"
16 #include "strings_type.h"
17 
18 static const int CF_NOEURO = 0;
19 static const int CF_ISEURO = 1;
20 
26 enum Currencies {
62 };
63 
65 struct CurrencySpec {
66  uint16 rate;
67  char separator[8];
69  char prefix[16];
70  char suffix[16];
80  byte symbol_pos;
81  StringID name;
82 };
83 
85 
86 /* XXX small hack, but makes the rest of the code a bit nicer to read */
87 #define _custom_currency (_currency_specs[CURRENCY_CUSTOM])
88 #define _currency ((const CurrencySpec*)&_currency_specs[GetGameSettings().locale.currency])
89 
91 void CheckSwitchToEuro();
92 void ResetCurrencies(bool preserve_custom = true);
94 byte GetNewgrfCurrencyIdConverted(byte grfcurr_id);
95 
96 #endif /* CURRENCY_H */