00001 #ifndef _PLAYERLIST_H_ 00002 #define _PLAYERLSIT_H_ 00003 00004 #include "player.h" 00005 #include <stdlib.h> 00006 00007 class PlayerList{ 00008 private: 00009 Player **players; 00010 bool *freeslots; 00011 int numplayers; 00012 int maxplayers; 00013 int insertpos; 00014 bool isnotfull; 00015 public: 00016 PlayerList(); 00017 int setMaxPlayers(int num); 00018 int getMaxPlayers(); 00019 int getNumPlayers(); 00020 int addPlayer(Player *p); 00021 int removePlayerById(int playerid); 00022 void removeAllPlayers(); 00023 Player *getPlayerById(int playerid); 00024 char *getPlayerNameById(int playerid); 00025 00026 int setPlayerLatancy(int playerid, int latancy); 00027 int getPlayerLatancy(int playerid); 00028 void setPlayerName(int playerid, const char *name); 00029 int setLastTimeStamp(int playerid, DWORD timestamp); 00030 DWORD getLastTimeSamp(int playerid); 00031 int getFreeId(); 00032 00033 bool isNotFull(); 00034 00035 }; 00036 00037 00038 #endif