playsingle_controller.hpp

Go to the documentation of this file.
00001 /* $Id: playsingle_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 PLAYSINGLE_CONTROLLER_H_INCLUDED
00018 #define PLAYSINGLE_CONTROLLER_H_INCLUDED
00019 
00020 #include "play_controller.hpp"
00021 #include "replay.hpp"
00022 
00023 class playsingle_controller : public play_controller
00024 {
00025 public:
00026     playsingle_controller(const config& level, game_state& state_of_game,
00027         const int ticks, const int num_turns, const config& game_config, CVideo& video, bool skip_replay);
00028     virtual ~playsingle_controller();
00029 
00030     LEVEL_RESULT play_scenario(const config::const_child_itors &story,
00031         bool skip_replay);
00032 
00033     virtual void handle_generic_event(const std::string& name);
00034 
00035     virtual void recruit();
00036     virtual void repeat_recruit();
00037     virtual void recall();
00038     virtual bool can_execute_command(hotkey::HOTKEY_COMMAND command, int index=-1) const;
00039     virtual void toggle_shroud_updates();
00040     virtual void update_shroud_now();
00041     virtual void end_turn();
00042     virtual void force_end_turn();
00043     virtual void rename_unit();
00044     virtual void create_unit();
00045     virtual void change_side();
00046     virtual void label_terrain(bool);
00047     virtual void clear_labels();
00048     virtual void continue_move();
00049     virtual void unit_hold_position();
00050     virtual void end_unit_turn();
00051     virtual void user_command();
00052     virtual void custom_command();
00053     virtual void ai_formula();
00054     virtual void clear_messages();
00055     // Whiteboard hotkeys
00056     virtual void whiteboard_toggle();
00057     virtual void whiteboard_execute_action();
00058     virtual void whiteboard_execute_all_actions();
00059     virtual void whiteboard_delete_action();
00060     virtual void whiteboard_bump_up_action();
00061     virtual void whiteboard_bump_down_action();
00062     virtual void whiteboard_suppose_dead();
00063     void linger();
00064 
00065     virtual void force_end_level(LEVEL_RESULT res)
00066     { level_result_ = res; }
00067     virtual void check_end_level();
00068 
00069 protected:
00070     virtual void play_turn(bool save);
00071     virtual void play_side(const unsigned int side_number, bool save);
00072     virtual void before_human_turn(bool save);
00073     void show_turn_dialog();
00074     void execute_gotos();
00075     virtual void play_human_turn();
00076     virtual void after_human_turn();
00077     void end_turn_record();
00078     void end_turn_record_unlock();
00079     virtual hotkey::ACTION_STATE get_action_state(hotkey::HOTKEY_COMMAND command, int index) const;
00080     void play_ai_turn();
00081     virtual void init_gui();
00082     void check_time_over();
00083     void store_recalls();
00084     void store_gold(bool obs = false);
00085 
00086     const cursor::setter cursor_setter;
00087     std::deque<config> data_backlog_;
00088     gui::floating_textbox textbox_info_;
00089     replay_network_sender replay_sender_;
00090 
00091     bool end_turn_;
00092     bool player_type_changed_;
00093     bool replaying_;
00094     bool turn_over_;
00095     bool skip_next_turn_;
00096     LEVEL_RESULT level_result_;
00097 private:
00098     void report_victory(std::ostringstream &report, int player_gold,
00099         int remaining_gold, int finishing_bonus_per_turn,
00100         int turns_left, int finishing_bonus);
00101 };
00102 
00103 
00104 #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