The Battle for Wesnoth  1.17.0-dev
help_topic_generators.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2021
3  by David White <dave@whitevine.net>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 #pragma once
17 
18 #include "help_impl.hpp"
19 
20 #include <string> // for string
21 #include <utility> // for pair
22 #include <vector> // for vector
23 class terrain_type; // lines 20-20
24 class unit_type;
25 
26 namespace help {
27 
29 {
31 
32 
33 public:
34  terrain_topic_generator(const terrain_type& type) : type_(type) {}
35 
36  virtual std::string operator()() const;
37 };
38 
39 
40 
42 {
43  const unit_type& type_;
44  const std::string variation_;
45  void push_header(std::vector< help::item > &row, const std::string& name) const;
46 public:
47  unit_topic_generator(const unit_type &t, std::string variation="") : type_(t), variation_(variation) {}
48  virtual std::string operator()() const;
49 };
50 
51 } // end namespace help/
terrain_topic_generator(const terrain_type &type)
A single unit type that the player may recruit.
Definition: types.hpp:45
virtual std::string operator()() const
double t
Definition: astarsearch.cpp:65
Generate a topic text on the fly.
Definition: help_impl.hpp:64
unit_topic_generator(const unit_type &t, std::string variation="")
Definition: help.cpp:57