Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef PLAYMP_CONTROLLER_H_INCLUDED
00018 #define PLAYMP_CONTROLLER_H_INCLUDED
00019
00020 #include "playsingle_controller.hpp"
00021
00022 class turn_info;
00023
00024 class playmp_controller : public playsingle_controller, public events::pump_monitor
00025 {
00026 public:
00027 playmp_controller(const config& level, game_state& state_of_game,
00028 const int ticks, const int num_turns, const config& game_config, CVideo& video,
00029 bool skip_replay, bool is_host);
00030 virtual ~playmp_controller();
00031
00032 bool is_host() const { return is_host_; }
00033
00034 static unsigned int replay_last_turn() { return replay_last_turn_; }
00035 static void set_replay_last_turn(unsigned int turn);
00036
00037 bool counting_down();
00038 void reset_countdown();
00039 void think_about_countdown(int ticks);
00040 void process(events::pump_info &info);
00041 void linger();
00042
00043 void wait_for_upload();
00044 void process_oos(const std::string& err_msg) const;
00045
00046 protected:
00047 virtual void handle_generic_event(const std::string& name);
00048
00049 virtual void speak();
00050 virtual void whisper();
00051 virtual void shout();
00052 virtual void start_network();
00053 virtual void stop_network();
00054 virtual bool can_execute_command(hotkey::HOTKEY_COMMAND command, int index=-1) const;
00055
00056 virtual void play_side(const unsigned int side_number, bool save);
00057 virtual void before_human_turn(bool save);
00058 virtual void play_human_turn();
00059 virtual void after_human_turn();
00060 virtual void finish_side_turn();
00061 void play_network_turn();
00062 void init_turn_data();
00063
00064 turn_info* turn_data_;
00065
00066 int beep_warning_time_;
00067 mutable bool network_processing_stopped_;
00068 private:
00069 void set_end_scenario_button();
00070 void reset_end_scenario_button();
00071 static unsigned int replay_last_turn_;
00072 };
00073
00074 #endif