mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Mapgen: Refactor mapgen creation and management
- Move mapgen creation logic out of EmergeManager and into Mapgen - Internally represent mapgen type as an enum value, instead of a string - Remove the need for a MapgenFactory per mapgen
This commit is contained in:
parent
70e2c1c7d4
commit
92705306bf
12 changed files with 160 additions and 164 deletions
|
@ -31,7 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
#include "filesys.h"
|
||||
#include "convert_json.h"
|
||||
#include "serverlist.h"
|
||||
#include "emerge.h"
|
||||
#include "mapgen.h"
|
||||
#include "sound.h"
|
||||
#include "settings.h"
|
||||
#include "log.h"
|
||||
|
@ -707,7 +707,7 @@ int ModApiMainMenu::l_set_topleft_text(lua_State *L)
|
|||
int ModApiMainMenu::l_get_mapgen_names(lua_State *L)
|
||||
{
|
||||
std::vector<const char *> names;
|
||||
EmergeManager::getMapgenNames(&names, lua_toboolean(L, 1));
|
||||
Mapgen::getMapgenNames(&names, lua_toboolean(L, 1));
|
||||
|
||||
lua_newtable(L);
|
||||
for (size_t i = 0; i != names.size(); i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue