playmp_controller.hpp

Go to the documentation of this file.
00001 /* $Id: playmp_controller.hpp 52533 2012-01-07 02:35:17Z shadowmaster $ */
00002 /*
00003    Copyright (C) 2006 - 2012 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 as published by
00009    the Free Software Foundation; either version 2 of the License, or
00010    (at your option) any later version.
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY.
00013 
00014    See the COPYING file for more details.
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     /** Wait for the host to upload the next scenario. */
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
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Fri May 25 2012 01:03:08 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs