The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
game_launcher.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2016 by David White <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 #ifndef GAME_LAUNCHER_H_INCLUDED
15 #define GAME_LAUNCHER_H_INCLUDED
16 
17 #include "global.hpp"
18 
19 #include "editor/editor_main.hpp" // for EXIT_STATUS
20 #include "events.hpp" // for event_context
21 #include "font.hpp" // for manager
22 #include "game_errors.hpp" // for load_game_exception, etc
23 #include "game_preferences.hpp" // for manager
24 #include "hotkey/hotkey_manager.hpp" // for manager
25 #include "image.hpp" // for manager
26 #include "saved_game.hpp" // for saved_game
27 #include "scoped_resource.hpp" // for scoped_ptr
28 #include "sound.hpp" // for music_thinker
29 
30 #include <boost/scoped_ptr.hpp>
31 #include <string> // for string
32 #include <vector> // for vector
33 
35 class config;
36 class CVideo;
37 
39 {
40 public:
41  jump_to_campaign_info(bool jump,int difficulty, std::string campaign_id,std::string scenario_id)
42  : jump_(jump)
43  , difficulty_(difficulty)
44  , campaign_id_(campaign_id)
45  , scenario_id_(scenario_id)
46  {
47  }
48  bool jump_;
51 };
52 
54 {
55 public:
56  game_launcher(const commandline_options& cmdline_opts, const char* appname);
58 
59  CVideo& video() { return *video_; }
60 
61  bool init_video();
62  bool init_language();
63  bool init_joystick();
64  bool init_lua_script();
65 
66  bool play_test();
67  bool play_screenshot_mode();
69  int unit_test();
70 
71  bool is_loading() const;
73  bool load_game();
74  void set_tutorial();
75 
77  bool new_campaign();
78  bool goto_campaign();
79  bool goto_multiplayer();
80  bool goto_editor();
81 
82  bool jump_to_editor() const { return jump_to_editor_; }
83 
84  bool play_multiplayer();
86  bool change_language();
87 
88  void show_preferences();
89 
92  void play_replay();
93 
95 
96  void start_wesnothd();
97 
98  const commandline_options & opts() const { return cmdline_opts_; }
99 private:
101  void operator=(const game_launcher&);
102 
103  void mark_completed_campaigns(std::vector<config>& campaigns);
104 
106 
108  //Never null.
109  boost::scoped_ptr<CVideo> video_;
110 
117 
119 
121 
124 
128 
130 };
131 
132 #endif
CVideo & video()
const hotkey::manager hotkey_manager_
static std::string game
Definition: game_errors.hpp:89
boost::scoped_ptr< CVideo > video_
const commandline_options & opts() const
this class is initialized once at game start put all initialization and wipe code in the methods here...
void show_preferences()
Definition: video.hpp:58
bool jump_to_editor() const
void mark_completed_campaigns(std::vector< config > &campaigns)
bool change_language()
scoped_resource: class template, functions, helper policies etc. for resource management.
jump_to_campaign_info jump_to_campaign_
bool play_render_image_mode()
std::string multiplayer_server_
editor::EXIT_STATUS start_editor()
game_launcher(const commandline_options &cmdline_opts, const char *appname)
std::string screenshot_map_
std::string jump_to_campaign_id() const
bool play_multiplayer()
jump_to_campaign_info(bool jump, int difficulty, std::string campaign_id, std::string scenario_id)
const preferences::manager prefs_manager_
bool goto_multiplayer()
the image manager is responsible for setting up images, and destroying all images when the program ex...
Definition: image.hpp:167
void launch_game(RELOAD_GAME_DATA reload=RELOAD_DATA)
const commandline_options & cmdline_opts_
std::string jump(const unsigned amount)
Definition: help_impl.hpp:388
sound::music_thinker music_thinker_
std::string screenshot_filename_
saved_game state_
bool is_loading() const
const events::event_context main_event_context_
void clear_loaded_game()
void operator=(const game_launcher &)
std::string test_scenario_
bool play_screenshot_mode()
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:83
GLsizei const GLcharARB ** string
Definition: glew.h:4503
const image::manager image_manager_
const font::manager font_manager_
bool init_lua_script()
bool play_multiplayer_commandline()