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 GAME_STATION_H
19 #define GAME_STATION_H
26 #include <sigc++/trackable.h>
27 #include <sigc++/signal.h>
28 #include <sigc++/connection.h>
30 #include "game-client-decoder.h"
32 class GameStation: public GameClientDecoder
36 sigc::signal<void, std::string> remote_participant_joins;
37 sigc::signal<void, Player*, std::string> player_sits;
38 sigc::signal<void, Player*, std::string> player_stands;
39 sigc::signal<void, std::string> remote_participant_departs;
40 sigc::signal<void> playerlist_reorder_received;
41 sigc::signal<void, Player*> local_player_moved;
42 sigc::signal<void, Player*> local_player_died;
43 sigc::signal<void, Player*> local_player_starts_move;
44 sigc::signal<void> round_begins;
46 void listenForLocalEvents(Player *p);
49 virtual ~GameStation();
51 virtual void onActionDone(NetworkAction *action) = 0;
52 virtual void onHistoryDone(NetworkHistory *history) = 0;
54 void clearNetworkActionlist(std::list<NetworkAction*> &actions);
55 void clearNetworkHistorylist(std::list<NetworkHistory*> &histories);
57 void stopListeningForLocalEvents(Player *p);
60 std::map<guint32, sigc::connection> action_listeners;
61 std::map<guint32, sigc::connection> history_listeners;