The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
playturn.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 
15 #ifndef PLAYTURN_HPP_INCLUDED
16 #define PLAYTURN_HPP_INCLUDED
17 
18 #include <string> // for string
19 #include "generic_event.hpp" // for generic_event
20 #include "replay.hpp"
21 
22 class config; // lines 18-18
24 
25 /**
26  TODO: rename this class since it isn't that much related to turns.
27 */
28 class turn_info
29 {
30 public:
31  turn_info(replay_network_sender &network_sender, playturn_network_adapter &network_reader);
32 
33  ~turn_info();
34 
35 
36 
38  {
42  /** When the host uploaded the next scenario this is returned. */
44  /** When we couldn't process the network data because we found a dependent command, this should only happen if we were called playmp_controller::from handle_generic_event -> sync_network*/
46  /** We foudn a player action in the replay that caused the game to end*/
48  };
49 
51 
52  void send_data();
53 
54  //function which will process incoming network data received with playturn_network_adapter, and act on it.
56 
57  //reads as much data from network_reader_ as possible and processed it.
59 
61 
63 private:
64  static void change_side_controller(int side, const std::string& player);
66 
67  void do_save();
68 
70 
72 
74 };
75 
76 #endif
static void change_side_controller(int side, const std::string &player)
Definition: playturn.cpp:373
replay_network_sender & replay_sender_
Definition: playturn.hpp:69
events::generic_event & host_transfer()
Definition: playturn.hpp:60
~turn_info()
Definition: playturn.cpp:60
events::generic_event host_transfer_
Definition: playturn.hpp:71
TODO: rename this class since it isn't that much related to turns.
Definition: playturn.hpp:28
PROCESS_DATA_RESULT sync_network()
Definition: playturn.cpp:64
Replay control code.
PROCESS_DATA_RESULT handle_turn(const config &t)
Definition: playturn.cpp:92
PROCESS_DATA_RESULT process_network_data_from_reader()
Definition: playturn.cpp:111
GLdouble GLdouble t
Definition: glew.h:1366
turn_info(replay_network_sender &network_sender, playturn_network_adapter &network_reader)
Definition: playturn.cpp:53
void send_data()
Definition: playturn.cpp:83
PROCESS_DATA_RESULT
Definition: playturn.hpp:37
REPLAY_RETURN
Definition: replay.hpp:155
When we couldn't process the network data because we found a dependent command, this should only happ...
Definition: playturn.hpp:45
playturn_network_adapter & network_reader_
Definition: playturn.hpp:73
PROCESS_DATA_RESULT process_network_data(const config &cfg)
Definition: playturn.cpp:126
When the host uploaded the next scenario this is returned.
Definition: playturn.hpp:43
We foudn a player action in the replay that caused the game to end.
Definition: playturn.hpp:47
void do_save()
Definition: playturn.cpp:104
static PROCESS_DATA_RESULT replay_to_process_data_result(REPLAY_RETURN replayreturn)
Definition: playturn.cpp:382
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