Doomseeker
   
  • Doomseeker
  • Wadseeker
  • Download
  • Tracker
  • Git
  • Docs
  • Main Page
  • Classes
  • Files
  • File List
  • File Members

src/core/serverapi/playerslist.h

00001 //------------------------------------------------------------------------------
00002 // playerslist.h
00003 //------------------------------------------------------------------------------
00004 //
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 //
00010 // This program is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with this program; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00018 // 02110-1301, USA.
00019 //
00020 //------------------------------------------------------------------------------
00021 // Copyright (C) 2010 "Zalewa" <zalewapl@gmail.com>
00022 //------------------------------------------------------------------------------
00023 #ifndef __PLAYERS_LIST_H_
00024 #define __PLAYERS_LIST_H_
00025 
00026 #include "global.h"
00027 #include "player.h"
00028 #include <QList>
00029 #include <QMap>
00030 
00031 class PlayersList;
00032 
00033 #define PairPlayersByTeams int, PlayersList
00034 
00039 typedef QMap<PairPlayersByTeams>        PlayersByTeams;
00040 
00041 class MAIN_EXPORT PlayersList : public QList<Player>
00042 {
00043         public:
00047                 void                            bots(PlayersList& botsList) const;
00048                 
00052                 void                            botsWithoutTeam(PlayersList& botsList) const;
00053 
00054                 int                                     numBots() const;
00055                 int                                     numBotsOnTeam(int team) const;
00056                 int                                     numBotsWithoutTeam() const;
00057 
00061                 int                                     numClients() const;
00062                 int                                     numClientsWithoutBots() const;
00063 
00064                 int                                     numHumansInGame() const;
00065                 int                                     numHumansOnTeam(int team) const;
00066                 int                                     numHumansWithoutTeam() const;
00067                 int                                     numPlayersOnTeam(int team) const;
00068                 int                                     numSpectators() const;
00069 
00079                 void                            inGamePlayersByTeams(QMap<PairPlayersByTeams>& playersListMap) const;
00080 
00081                 void                            spectators(PlayersList& spectatorsList) const;
00082 
00083 };
00084 
00085 #endif
   
Doomseeker © 2009-2024 The Doomseeker Team