diff options
author | kwolekr <kwolekr@minetest.net> | 2015-03-30 23:40:35 -0400 |
---|---|---|
committer | kwolekr <kwolekr@minetest.net> | 2015-03-31 01:11:51 -0400 |
commit | ed10005d381580440558dc49277b4d350f081283 (patch) | |
tree | a1ac2b831d883f6c43193a1c2a55860bf7e0d6ed /src/mg_schematic.h | |
parent | 6a48844eba16fb955ef4992bef539af66c595d0c (diff) | |
download | minetest-ed10005d381580440558dc49277b4d350f081283.tar.gz minetest-ed10005d381580440558dc49277b4d350f081283.tar.bz2 minetest-ed10005d381580440558dc49277b4d350f081283.zip |
GenElementManager: Pass opaque handles to Lua and rename to ObjDefManager
Add core.clear_registered_schematics() and refactor schematics somewhat
Diffstat (limited to 'src/mg_schematic.h')
-rw-r--r-- | src/mg_schematic.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mg_schematic.h b/src/mg_schematic.h index ad5afb15f..4a85f69a6 100644 --- a/src/mg_schematic.h +++ b/src/mg_schematic.h @@ -42,7 +42,7 @@ class NodeResolver; #define MTSCHEM_PROB_ALWAYS 0xFF -class Schematic : public GenElement, public NodeResolver { +class Schematic : public ObjDef, public NodeResolver { public: std::vector<content_t> c_nodes; @@ -62,7 +62,7 @@ public: Rotation rot, bool force_placement, INodeDefManager *ndef); bool loadSchematicFromFile(const char *filename, INodeDefManager *ndef, - std::map<std::string, std::string> &replace_names); + StringMap *replace_names); void saveSchematicToFile(const char *filename, INodeDefManager *ndef); bool getSchematicFromMap(Map *map, v3s16 p1, v3s16 p2); @@ -73,14 +73,16 @@ public: std::vector<std::pair<s16, u8> > *splist); }; -class SchematicManager : public GenElementManager { +class SchematicManager : public ObjDefManager { public: - static const char *ELEMENT_TITLE; - static const size_t ELEMENT_LIMIT = 0x10000; - SchematicManager(IGameDef *gamedef); ~SchematicManager() {} + const char *getObjectTitle() const + { + return "schematic"; + } + Schematic *create(int type) { return new Schematic; |