The Battle for Wesnoth  1.15.2+dev
help_topic_generators.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2018 by David White <dave@whitevine.net>
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 
17 #include "help_impl.hpp"
18 
19 #include <string> // for string
20 #include <utility> // for pair
21 #include <vector> // for vector
22 class terrain_type; // lines 20-20
23 class unit_type;
24 
25 namespace help {
26 
28 {
30 
31 
32 public:
33  terrain_topic_generator(const terrain_type& type) : type_(type) {}
34 
35  virtual std::string operator()() const;
36 };
37 
38 
39 
41 {
42  const unit_type& type_;
43  const std::string variation_;
44  void push_header(std::vector< help::item > &row, const std::string& name) const;
45 public:
46  unit_topic_generator(const unit_type &t, std::string variation="") : type_(t), variation_(variation) {}
47  virtual std::string operator()() const;
48 };
49 
50 } // end namespace help/
terrain_topic_generator(const terrain_type &type)
A single unit type that the player may recruit.
Definition: types.hpp:42
virtual std::string operator()() const
double t
Definition: astarsearch.cpp:64
Generate a topic text on the fly.
Definition: help_impl.hpp:60
unit_topic_generator(const unit_type &t, std::string variation="")
Definition: help.cpp:55