The Battle for Wesnoth  1.15.1+dev
player_connection.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2016 - 2018 by Sergey Popov <loonycyborg@gmail.com>
3  Part of the Battle for Wesnoth Project https://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 
16 
17 #include "server/game.hpp"
18 
19 namespace wesnothd
20 {
21 const std::shared_ptr<game> player_record::get_game() const
22 {
23  return game_;
24 }
25 
26 std::shared_ptr<game>& player_record::get_game()
27 {
28  return game_;
29 }
30 
32 {
33  return game_ ? game_->id() : 0;
34 }
35 
36 void player_record::set_game(std::shared_ptr<game> new_game)
37 {
38  game_ = new_game;
39 }
40 
42 {
43  game_.reset();
44 }
45 
46 }
std::shared_ptr< game > game_
const std::shared_ptr< game > get_game() const
void set_game(std::shared_ptr< game > new_game)
Definition: ban.cpp:28