(svn r14421) -Codechange: rename all player variables/types to company *or* client so it is immediatelly clear which one you are working with.
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user