# currency.h

Go to the documentation of this file.

    00001 /* $Id$ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * 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.
    00006  * 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.
    00007  * 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/>.
    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 = 32;
    00021 static const int CUSTOM_CURRENCY_ID = NUM_CURRENCY - 1;
    00022
    00024 struct CurrencySpec {
    00025   uint16 rate;
    00026   char separator[8];
    00027   Year to_euro;
    00028   char prefix[16];
    00029   char suffix[16];
    00039   byte symbol_pos;
    00040   StringID name;
    00041 };
    00042
    00043
    00044 extern CurrencySpec _currency_specs[NUM_CURRENCY];
    00045
    00046 /* XXX small hack, but makes the rest of the code a bit nicer to read */
    00047 #define _custom_currency (_currency_specs[CUSTOM_CURRENCY_ID])
    00048 #define _currency ((const CurrencySpec*)&_currency_specs[GetGameSettings().locale.currency])
    00049
    00050 uint GetMaskOfAllowedCurrencies();
    00051 void CheckSwitchToEuro();
    00052 void ResetCurrencies(bool preserve_custom = true);
    00053 StringID *BuildCurrencyDropdown();
    00054 byte GetNewgrfCurrencyIdConverted(byte grfcurr_id);
    00055
    00056 #endif /* CURRENCY_H */