The Battle for Wesnoth  1.15.0+dev
set_starting_position.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2011 - 2018 by Iris Morelle <shadowm2006@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 
15 #pragma once
16 
18 
19 #include <vector>
20 
21 struct map_location;
22 
23 namespace gui2
24 {
25 namespace dialogs
26 {
27 
29 {
30 public:
32  unsigned current_player,
33  unsigned maximum_players,
34  const std::vector<map_location>& starting_positions);
35 
36  unsigned result() const
37  {
38  return selection_;
39  }
40 
41 private:
42  unsigned selection_;
43  std::vector<map_location> starting_positions_;
44 
45  /** Inherited from modal_dialog, implemented by REGISTER_DIALOG. */
46  virtual const std::string& window_id() const override;
47 
48  /** Inherited from modal_dialog. */
49  virtual void pre_show(window& window) override;
50 
51  /** Inherited from modal_dialog. */
52  virtual void post_show(window& window) override;
53 };
54 } // namespace dialogs
55 } // namespace gui2
boost::bimaps::bimap< boost::bimaps::set_of< std::string >, boost::bimaps::multiset_of< coordinate > > starting_positions
Generic file dialog.
Definition: field-fwd.hpp:22
editor_set_starting_position(unsigned current_player, unsigned maximum_players, const std::vector< map_location > &starting_positions)
Various uncategorised dialogs.
Encapsulates the map of the game.
Definition: location.hpp:42
virtual void post_show(window &window) override
Inherited from modal_dialog.
virtual void pre_show(window &window) override
Inherited from modal_dialog.
Abstract base class for all modal dialogs.
virtual const std::string & window_id() const override
Inherited from modal_dialog, implemented by REGISTER_DIALOG.
base class of top level items, the only item which needs to store the final canvases to draw on ...
Definition: window.hpp:63