The Battle for Wesnoth  1.17.0-dev
lua_map_generator.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2021
3  by Chris Beck <render787@gmail.com>
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 "config.hpp"
19 #include "map_generator.hpp"
20 
22 
23 #include <string>
24 
26 public:
27  lua_map_generator(const config & cfg, const config* vars);
28 
29  bool allow_user_config() const override { return !user_config_.empty(); }
30 
31  std::string name() const override { return "lua"; }
32 
33  std::string id() const { return id_; }
34 
35  std::string config_name() const override { return config_name_; }
36 
37  virtual void user_config() override;
38  virtual std::string create_map(std::optional<uint32_t> randomseed) override;
39  virtual config create_scenario(std::optional<uint32_t> randomseed) override;
40 
41 private:
42  std::string id_, config_name_;
43 
44  std::string user_config_;
45  std::string create_map_;
46  std::string create_scenario_;
47 
49 
51 };
std::string id() const
std::string config_name() const override
Return a friendly name for the generator used to differentiate between different configs of the same ...
lua_map_generator(const config &cfg, const config *vars)
Definitions for the interface to Wesnoth Markup Language (WML).
std::string name() const override
Returns a string identifying the generator by name.
bool allow_user_config() const override
Returns true if the map generator has an interactive screen, which allows the user to modify how the ...
virtual void user_config() override
Display the interactive screen, which allows the user to modify how the generator behaves...
virtual std::string create_map(std::optional< uint32_t > randomseed) override
Creates a new map and returns it.
std::string create_scenario_
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:61
mapgen_lua_kernel lk_
virtual config create_scenario(std::optional< uint32_t > randomseed) override