diff options
author | rubidium <rubidium@openttd.org> | 2008-09-30 20:39:50 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-09-30 20:39:50 +0000 |
commit | 3b798599b63067c2e92aa49906ea66a07ae8de44 (patch) | |
tree | 69fb7ae1d9bdadb9e7386cb70b0a26621ad9b57f /src/player_func.h | |
parent | cc1e761edab14f8264dba44d09f7272d931bdd93 (diff) | |
download | openttd-3b798599b63067c2e92aa49906ea66a07ae8de44.tar.xz |
(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
Diffstat (limited to 'src/player_func.h')
-rw-r--r-- | src/player_func.h | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/player_func.h b/src/player_func.h index cc55f4661..66f5161a9 100644 --- a/src/player_func.h +++ b/src/player_func.h @@ -1,49 +1,49 @@ /* $Id$ */ -/** @file player_func.h Functions related to players. */ +/** @file company_func.h Functions related to companies. */ -#ifndef PLAYER_FUNC_H -#define PLAYER_FUNC_H +#ifndef COMPANY_FUNC_H +#define COMPANY_FUNC_H #include "core/math_func.hpp" #include "player_type.h" #include "tile_type.h" #include "strings_type.h" -void ChangeOwnershipOfPlayerItems(PlayerID old_player, PlayerID new_player); +void ChangeOwnershipOfCompanyItems(Owner old_owner, Owner new_owner); void GetNameOfOwner(Owner owner, TileIndex tile); -void SetLocalPlayer(PlayerID new_player); +void SetLocalCompany(CompanyID new_company); -extern PlayerByte _local_player; -extern PlayerByte _current_player; -/* NOSAVE: can be determined from player structs */ -extern byte _player_colors[MAX_PLAYERS]; -extern PlayerFace _player_face; ///< for player face storage in openttd.cfg +extern CompanyByte _local_company; +extern CompanyByte _current_company; -bool IsHumanPlayer(PlayerID pi); +extern byte _company_colours[MAX_COMPANIES]; ///< NOSAVE: can be determined from company structs +extern CompanyManagerFace _company_manager_face; ///< for company manager face storage in openttd.cfg -static inline bool IsLocalPlayer() +bool IsHumanCompany(CompanyID company); + +static inline bool IsLocalCompany() { - return _local_player == _current_player; + return _local_company == _current_company; } -static inline bool IsInteractivePlayer(PlayerID pi) +static inline bool IsInteractiveCompany(CompanyID company) { - return pi == _local_player; + return company == _local_company; } struct HighScore { char company[100]; - StringID title; ///< NO_SAVE, has troubles with changing string-numbers. + StringID title; ///< NOSAVE, has troubles with changing string-numbers. uint16 score; ///< do NOT change type, will break hs.dat }; extern HighScore _highscore_table[5][5]; // 4 difficulty-settings (+ network); top 5 void SaveToHighScore(); void LoadFromHighScore(); -int8 SaveHighScoreValue(const Player *p); +int8 SaveHighScoreValue(const Company *p); int8 SaveHighScoreValueNetwork(); -#endif /* PLAYER_FUNC_H */ +#endif /* COMPANY_FUNC_H */ |