|
@@ -7,13 +7,13 @@
|
|
|
|
|
|
/** @file currency.h Functions to handle different currencies. */
|
|
|
|
|
|
#ifndef CURRENCY_H
|
|
|
#define CURRENCY_H
|
|
|
|
|
|
#include "date_type.h"
|
|
|
#include "timer/timer_game_calendar.h"
|
|
|
#include "string_func.h"
|
|
|
#include "strings_type.h"
|
|
|
|
|
|
static const int CF_NOEURO = 0; ///< Currency never switches to the Euro (as far as known).
|
|
|
static const int CF_ISEURO = 1; ///< Currency _is_ the Euro.
|
|
|
|
|
@@ -69,13 +69,13 @@ enum Currencies {
|
|
|
};
|
|
|
|
|
|
/** Specification of a currency. */
|
|
|
struct CurrencySpec {
|
|
|
uint16 rate; ///< The conversion rate compared to the base currency.
|
|
|
std::string separator; ///< The thousands separator for this currency.
|
|
|
Year to_euro; ///< %Year of switching to the Euro. May also be #CF_NOEURO or #CF_ISEURO.
|
|
|
TimerGameCalendar::Year to_euro; ///< Year of switching to the Euro. May also be #CF_NOEURO or #CF_ISEURO.
|
|
|
std::string prefix; ///< Prefix to apply when formatting money in this currency.
|
|
|
std::string suffix; ///< Suffix to apply when formatting money in this currency.
|
|
|
/**
|
|
|
* The currency symbol is represented by two possible values, prefix and suffix
|
|
|
* Usage of one or the other is determined by #symbol_pos.
|
|
|
* 0 = prefix
|
|
@@ -86,13 +86,13 @@ struct CurrencySpec {
|
|
|
*/
|
|
|
byte symbol_pos;
|
|
|
StringID name;
|
|
|
|
|
|
CurrencySpec() = default;
|
|
|
|
|
|
CurrencySpec(uint16 rate, const char *separator, Year to_euro, const char *prefix, const char *suffix, byte symbol_pos, StringID name) :
|
|
|
CurrencySpec(uint16 rate, const char *separator, TimerGameCalendar::Year to_euro, const char *prefix, const char *suffix, byte symbol_pos, StringID name) :
|
|
|
rate(rate), separator(separator), to_euro(to_euro), prefix(prefix), suffix(suffix), symbol_pos(symbol_pos), name(name)
|
|
|
{
|
|
|
}
|
|
|
};
|
|
|
|
|
|
extern CurrencySpec _currency_specs[CURRENCY_END];
|