playsingle_controller.hpp

Go to the documentation of this file.
00001 /* $Id: playsingle_controller.hpp 26242 2008-04-30 03:52:10Z alink $ */
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 PLAYSINGLE_CONTROLLER_H_INCLUDED
00017 #define PLAYSINGLE_CONTROLLER_H_INCLUDED
00018 
00019 #include "global.hpp"
00020 
00021 #include "cursor.hpp"
00022 #include "menu_events.hpp"
00023 #include "play_controller.hpp"
00024 
00025 struct upload_log;
00026 
00027 #include <vector>
00028 
00029 class playsingle_controller : public play_controller
00030 {
00031 public:
00032     playsingle_controller(const config& level, game_state& state_of_game,
00033         const int ticks, const int num_turns, const config& game_config, CVideo& video, bool skip_replay);
00034 
00035     LEVEL_RESULT play_scenario(const std::vector<config*>& story, upload_log& log, bool skip_replay);
00036 
00037     virtual void handle_generic_event(const std::string& name);
00038 
00039     virtual void recruit();
00040     virtual void repeat_recruit();
00041     virtual void recall();
00042     virtual bool can_execute_command(hotkey::HOTKEY_COMMAND command, int index=-1) const;
00043     virtual void toggle_shroud_updates();
00044     virtual void update_shroud_now();
00045     virtual void end_turn();
00046     virtual void rename_unit();
00047     virtual void create_unit();
00048     virtual void change_unit_side();
00049     virtual void label_terrain(bool);
00050     virtual void continue_move();
00051     virtual void unit_hold_position();
00052     virtual void end_unit_turn();
00053     virtual void user_command();
00054     virtual void custom_command();
00055     virtual void ai_formula();
00056     virtual void clear_messages();
00057 #ifdef USRCMD2
00058     virtual void user_command_2();
00059     virtual void user_command_3();
00060 #endif
00061     void linger(upload_log& log);
00062 
00063 protected:
00064     virtual void play_turn(bool no_save);
00065     virtual void play_side(const unsigned int team_index, bool save);
00066     virtual void before_human_turn(bool save);
00067     virtual void play_human_turn();
00068     virtual void after_human_turn();
00069     void end_turn_record();
00070     void end_turn_record_unlock();
00071     void play_ai_turn();
00072     virtual void init_gui();
00073     void check_time_over();
00074 
00075     const cursor::setter cursor_setter;
00076     std::deque<config> data_backlog_;
00077     gui::floating_textbox textbox_info_;
00078     replay_network_sender replay_sender_;
00079 
00080     bool end_turn_;
00081     bool player_type_changed_;
00082     bool replaying_;
00083 private:
00084     bool turn_over_;
00085     void report_victory(std::stringstream& report,
00086             end_level_exception& end_level,
00087             int player_gold,
00088             int remaining_gold, int finishing_bonus_per_turn,
00089             int turns_left, int finishing_bonus);
00090 };
00091 
00092 
00093 #endif

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