playmp_controller.hpp

Go to the documentation of this file.
00001 /* $Id: playmp_controller.hpp 25333 2008-03-30 13:49:03Z jhinrichs $ */
00002 /*
00003    Copyright (C) 2006 - 2008 by Joerg Hinrichs <joerg.hinrichs@alice-dsl.de>
00004    wesnoth playlevel Copyright (C) 2003 by David White <dave@whitevine.net>
00005    Part of the Battle for Wesnoth Project http://www.wesnoth.org/
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License version 2
00009    or at your option any later version.
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY.
00012 
00013    See the COPYING file for more details.
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     //! Wait for the host to upload the next scenario.
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

Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs