src/player_func.h
changeset 10208 72c00af5c95d
parent 10207 c291a21b304e
child 10209 a1e7417bf1b7
equal deleted inserted replaced
10207:c291a21b304e 10208:72c00af5c95d
     1 /* $Id$ */
       
     2 
       
     3 /** @file company_func.h Functions related to companies. */
       
     4 
       
     5 #ifndef COMPANY_FUNC_H
       
     6 #define COMPANY_FUNC_H
       
     7 
       
     8 #include "core/math_func.hpp"
       
     9 #include "player_type.h"
       
    10 #include "tile_type.h"
       
    11 #include "strings_type.h"
       
    12 
       
    13 void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner);
       
    14 void GetNameOfOwner(Owner owner, TileIndex tile);
       
    15 void SetLocalCompany(CompanyID new_company);
       
    16 
       
    17 extern CompanyByte _local_company;
       
    18 extern CompanyByte _current_company;
       
    19 
       
    20 extern byte _company_colours[MAX_COMPANIES];     ///< NOSAVE: can be determined from company structs
       
    21 extern CompanyManagerFace _company_manager_face; ///< for company manager face storage in openttd.cfg
       
    22 
       
    23 bool IsHumanCompany(CompanyID company);
       
    24 
       
    25 static inline bool IsLocalCompany()
       
    26 {
       
    27 	return _local_company == _current_company;
       
    28 }
       
    29 
       
    30 static inline bool IsInteractiveCompany(CompanyID company)
       
    31 {
       
    32 	return company == _local_company;
       
    33 }
       
    34 
       
    35 
       
    36 
       
    37 struct HighScore {
       
    38 	char company[100];
       
    39 	StringID title; ///< NOSAVE, has troubles with changing string-numbers.
       
    40 	uint16 score;   ///< do NOT change type, will break hs.dat
       
    41 };
       
    42 
       
    43 extern HighScore _highscore_table[5][5]; // 4 difficulty-settings (+ network); top 5
       
    44 void SaveToHighScore();
       
    45 void LoadFromHighScore();
       
    46 int8 SaveHighScoreValue(const Company *p);
       
    47 int8 SaveHighScoreValueNetwork();
       
    48 
       
    49 #endif /* COMPANY_FUNC_H */