replay_controller.hpp

Go to the documentation of this file.
00001 /* $Id: replay_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 REPLAY_CONTROLLER_H_INCLUDED
00017 #define REPLAY_CONTROLLER_H_INCLUDED
00018 
00019 class video;
00020 
00021 #include "play_controller.hpp"
00022 
00023 #include <vector>
00024 
00025 class replay_controller : public play_controller
00026 {
00027 public:
00028     replay_controller(const config& level, game_state& state_of_game,
00029         const int ticks, const int num_turns, const config& game_config, CVideo& video);
00030     ~replay_controller();
00031 
00032     virtual bool can_execute_command(hotkey::HOTKEY_COMMAND command, int index=-1) const;
00033 
00034     //event handlers
00035     virtual void preferences();
00036     virtual void show_statistics();
00037     void play_replay();
00038     void reset_replay();
00039     void stop_replay();
00040     void replay_next_turn();
00041     void replay_next_side();
00042     void replay_show_everything();
00043     void replay_show_each();
00044     void replay_show_team1();
00045     void replay_skip_animation();
00046 
00047     std::vector<team> teams_start_;
00048 
00049 protected:
00050     virtual void init_gui();
00051 
00052 private:
00053     bool continue_replay();
00054     void init();
00055     virtual void play_turn();
00056     virtual void play_side(const unsigned int team_index, bool save);
00057     void update_teams();
00058     void update_gui();
00059     void init_replay_display();
00060     void rebuild_replay_theme();
00061     void handle_generic_event(const std::string& /*name*/);
00062 
00063     game_state gamestate_start_;
00064     gamestatus status_start_;
00065     unit_map units_start_;
00066 
00067     unsigned int current_turn_;
00068     int delay_;
00069     bool is_playing_;
00070 
00071     bool show_everything_;
00072     unsigned int show_team_;
00073 };
00074 
00075 
00076 LEVEL_RESULT play_replay_level(const config& terrain_config,
00077         const config* level, CVideo& video,
00078         game_state& state_of_game);
00079 
00080 #endif

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