26
26
#include "splash-window.h"
27
27
#include "game-window.h"
28
#include "../game-parameters.h"
28
#include "game-lobby-dialog.h"
29
#include "new-network-game-download-window.h"
30
#include "game-parameters.h"
30
32
// takes care of setting up the splash window and the game window, the
31
33
// interaction between them and the model classes
34
// it also takes care of the game lobby window.
32
35
class Driver: public sigc::trackable
38
Driver(std::string load_filename);
42
static std::string create_and_dump_scenario(const std::string &file,
43
const GameParameters &g);
39
46
std::auto_ptr<GameWindow> game_window;
47
std::auto_ptr<GameLobbyDialog> game_lobby_dialog;
40
48
std::auto_ptr<SplashWindow> splash_window;
49
std::auto_ptr<NewNetworkGameDownloadWindow> download_window;
50
std::string d_load_filename;
51
sigc::connection heartbeat_conn;
52
Player::Type robot_player_type;
53
unsigned int number_of_robots;
54
std::string game_scenario_downloaded;
55
sigc::signal<void, std::string> game_scenario_received;
56
sigc::signal<void, Player*> player_replaced;
42
58
void on_new_game_requested(GameParameters g);
43
void on_new_network_game_requested(std::string filename, bool has_ops);
59
void on_new_campaign_requested(GameParameters g);
60
void on_new_remote_network_game_requested(std::string host, unsigned short port, std::string nick);
61
void on_new_hosted_network_game_requested(GameParameters g, int port, std::string nick);
62
void on_new_pbm_game_requested(GameParameters g);
63
void on_game_scenario_downloaded(std::string filename);
64
void on_game_scenario_received(std::string path);
44
65
void on_load_requested(std::string filename);
45
66
void on_quit_requested();
47
68
void on_game_ended();
69
void on_next_scenario(std::string scenario, int gold, std::list<Hero*> heroes, std::string player_name);
49
71
void init_game_window();
74
void on_hosted_player_sat_down(Player *player);
75
void on_hosted_player_stood_up(Player *player);
76
void on_client_player_sat_down(Player *player);
77
void on_client_player_stood_up(Player *player);
78
void on_server_went_away();
79
void on_client_could_not_connect();
81
GameScenario *new_game(GameParameters g);
82
GameScenario *load_game(std::string file_path);
84
void stressTestNextRound();
86
void lordsawaromatic(std::string host, unsigned short port, Player::Type type, int num_players);
87
void on_game_scenario_received_for_robots(std::string path);
92
void on_client_player_chat(std::string message);
93
void on_hosted_player_chat(std::string message);
95
void on_show_lobby_requested();
97
void start_network_game_requested(GameScenario *game_scenario,
98
NextTurnNetworked *next_turn);
100
void on_player_unavailable(Player *p);