The Battle for Wesnoth 1.21.0-dev
 
Loading...
Searching...
No Matches
playcampaign.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2005 - 2025
3 by Philippe Plantier <ayin@anathas.org>
4 Copyright (C) 2003 - 2005 by David White <dave@whitevine.net>
5 Part of the Battle for Wesnoth Project https://www.wesnoth.org/
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY.
13
14 See the COPYING file for more details.
15*/
16
17#pragma once
18
19#include "queue_type.hpp"
21
22#include <set>
23#include <string>
24
25class saved_game;
27
29{
32 , is_host()
33 , current_turn(0)
34 , skip_replay(false)
36 , connection(wdc)
37 , queue_type(queue_type::normal)
38 {
39 }
40
41 /** players and observers */
42 std::set<std::string> connected_players;
43 bool is_host;
44 unsigned current_turn;
48 std::string queue_type;
50};
51
53{
54public:
55 campaign_controller(saved_game& state, bool is_unit_test = false)
56 : state_(state)
57 , is_unit_test_(is_unit_test)
58 , is_replay_(false)
59 , mp_info_(nullptr)
60 {
61 }
62
64
65 level_result::type play_game();
66 level_result::type play_replay()
67 {
68 is_replay_ = true;
69 return play_game();
70 }
71
73 {
74 mp_info_ = mp_info;
75 }
76
77private:
78 level_result::type playsingle_scenario(end_level_data& end_level);
79 level_result::type playmp_scenario(end_level_data& end_level);
80
82 const bool is_unit_test_;
85};
level_result::type play_game()
level_result::type playsingle_scenario(end_level_data &end_level)
mp_game_metadata * mp_info_
level_result::type play_replay()
void set_mp_info(mp_game_metadata *mp_info)
level_result::type playmp_scenario(end_level_data &end_level)
campaign_controller(saved_game &state, bool is_unit_test=false)
A class that represents a TCP/IP connection to the wesnothd server.
Contains the exception interfaces used to signal completion of a scenario, campaign or turn.
Additional information on the game outcome which can be provided by WML.
wesnothd_connection & connection
std::string queue_type
mp_game_metadata(wesnothd_connection &wdc)
std::set< std::string > connected_players
players and observers
The base template for associating string values with enum values.
Definition enum_base.hpp:33