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