00001 /* $Id: highscore.h 25528 2013-06-30 08:58:35Z rubidium $ */ 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 HIGHSCORE_H 00013 #define HIGHSCORE_H 00014 00015 #include "strings_type.h" 00016 #include "company_type.h" 00017 #include "settings_type.h" 00018 00019 struct HighScore { 00025 char company[(MAX_LENGTH_COMPANY_NAME_CHARS + MAX_LENGTH_PRESIDENT_NAME_CHARS + 5) * MAX_CHAR_LENGTH]; 00026 StringID title; 00027 uint16 score; 00028 }; 00029 00030 extern HighScore _highscore_table[SP_HIGHSCORE_END][5]; 00031 00032 void SaveToHighScore(); 00033 void LoadFromHighScore(); 00034 int8 SaveHighScoreValue(const Company *c); 00035 int8 SaveHighScoreValueNetwork(); 00036 StringID EndGameGetPerformanceTitleFromValue(uint value); 00037 void ShowHighscoreTable(int difficulty = SP_CUSTOM, int8 rank = -1); 00038 00039 #endif /* HIGHSCORE_H */