1 // Copyright (C) 2008 Ben Asselstine
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 3 of the License, or
6 // (at your option) any later version.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU Library General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 #ifndef PBM_GAME_SERVER_H
19 #define PBM_GAME_SERVER_H
25 #include <sigc++/trackable.h>
32 class PbmGameServer: public sigc::trackable
36 //! Returns the singleton instance. Creates a new one if neccessary.
37 static PbmGameServer * getInstance();
39 //! Deletes the singleton instance.
40 static void deleteInstance();
44 bool endTurn(std::string turnfile, bool &broken);
50 std::list<NetworkAction*> d_actions;
51 std::list<NetworkHistory*> d_histories;
52 void listenForActions();
53 void listenForHistories();
54 void onActionDone(NetworkAction *action);
55 void onHistoryDone(NetworkHistory *history);
57 void clearNetworkActionlist();
58 void clearNetworkHistorylist();
59 bool dumpActionsAndHistories(XML_Helper *helper);
61 //! A static pointer for the singleton instance.
62 static PbmGameServer * s_instance;