# player_func.h

Go to the documentation of this file.

    00001 /* $Id: player_func.h 11828 2008-01-13 01:21:35Z rubidium $ */
    00002
    00005 #ifndef PLAYER_FUNC_H
    00006 #define PLAYER_FUNC_H
    00007
    00008 #include "core/math_func.hpp"
    00009 #include "player_type.h"
    00010 #include "tile_type.h"
    00011 #include "strings_type.h"
    00012
    00013 void ChangeOwnershipOfPlayerItems(PlayerID old_player, PlayerID new_player);
    00014 void GetNameOfOwner(Owner owner, TileIndex tile);
    00015 void SetLocalPlayer(PlayerID new_player);
    00016
    00017 extern PlayerByte _local_player;
    00018 extern PlayerByte _current_player;
    00019 /* NOSAVE: can be determined from player structs */
    00020 extern byte _player_colors[MAX_PLAYERS];
    00021 extern PlayerFace _player_face;
    00022
    00023 bool IsHumanPlayer(PlayerID pi);
    00024
    00025 static inline bool IsLocalPlayer()
    00026 {
    00027   return _local_player == _current_player;
    00028 }
    00029
    00030 static inline bool IsValidPlayer(PlayerID pi)
    00031 {
    00032   return IsInsideBS(pi, PLAYER_FIRST, MAX_PLAYERS);
    00033 }
    00034
    00035 static inline bool IsInteractivePlayer(PlayerID pi)
    00036 {
    00037   return pi == _local_player;
    00038 }
    00039
    00040
    00041
    00042 struct HighScore {
    00043   char company[100];
    00044   StringID title;
    00045   uint16 score;
    00046 };
    00047
    00048 extern HighScore _highscore_table[5][5]; // 4 difficulty-settings (+ network); top 5
    00049 void SaveToHighScore();
    00050 void LoadFromHighScore();
    00051 int8 SaveHighScoreValue(const Player *p);
    00052 int8 SaveHighScoreValueNetwork();
    00053
    00054 #endif /* PLAYER_FUNC_H */