OpenTTD Source 20241224-master-gf74b0cf984
CurrencySpec Struct Reference

Specification of a currency. More...

#include <currency.h>

Public Member Functions

 CurrencySpec (uint16_t rate, const char *separator, TimerGameCalendar::Year to_euro, const char *prefix, const char *suffix, const char *code, uint8_t symbol_pos, StringID name)
 

Data Fields

uint16_t rate
 The conversion rate compared to the base currency.
 
std::string separator
 The thousands separator for this currency.
 
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.
 
std::string code
 3 letter untranslated code to identify the currency.
 
uint8_t symbol_pos
 The currency symbol is represented by two possible values, prefix and suffix Usage of one or the other is determined by symbol_pos.
 
StringID name
 

Detailed Description

Specification of a currency.

Definition at line 75 of file currency.h.

Constructor & Destructor Documentation

◆ CurrencySpec()

CurrencySpec::CurrencySpec ( uint16_t  rate,
const char *  separator,
TimerGameCalendar::Year  to_euro,
const char *  prefix,
const char *  suffix,
const char *  code,
uint8_t  symbol_pos,
StringID  name 
)
inline

Definition at line 96 of file currency.h.

Field Documentation

◆ code

std::string CurrencySpec::code

3 letter untranslated code to identify the currency.

Definition at line 81 of file currency.h.

Referenced by GameOptionsWindow::SetStringParameters().

◆ name

StringID CurrencySpec::name

Definition at line 92 of file currency.h.

◆ prefix

std::string CurrencySpec::prefix

Prefix to apply when formatting money in this currency.

Definition at line 79 of file currency.h.

Referenced by CustomCurrencyWindow::OnQueryTextFinished().

◆ rate

◆ separator

std::string CurrencySpec::separator

The thousands separator for this currency.

Definition at line 77 of file currency.h.

Referenced by CustomCurrencyWindow::OnQueryTextFinished().

◆ suffix

std::string CurrencySpec::suffix

Suffix to apply when formatting money in this currency.

Definition at line 80 of file currency.h.

Referenced by CustomCurrencyWindow::OnQueryTextFinished().

◆ symbol_pos

uint8_t CurrencySpec::symbol_pos

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 1 = suffix 2 = both : Special case only for custom currency. It is not a spec from Newgrf, rather a way to let users do what they want with custom currency

Definition at line 91 of file currency.h.

◆ to_euro

TimerGameCalendar::Year CurrencySpec::to_euro

Year of switching to the Euro. May also be CF_NOEURO or CF_ISEURO.

Definition at line 78 of file currency.h.

Referenced by CustomCurrencyWindow::OnClick(), and CustomCurrencyWindow::OnQueryTextFinished().


The documentation for this struct was generated from the following file: