mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-22 17:18:39 +00:00
Mode node definition loading from Lua (still not finished), fix metadata creation from name
This commit is contained in:
parent
6a8f9135de
commit
18bb0ea1ea
6 changed files with 188 additions and 51 deletions
|
@ -40,6 +40,7 @@ class NodeMetadata
|
|||
{
|
||||
public:
|
||||
typedef NodeMetadata* (*Factory)(std::istream&, IGameDef *gamedef);
|
||||
typedef NodeMetadata* (*Factory2)(IGameDef *gamedef);
|
||||
|
||||
NodeMetadata(IGameDef *gamedef);
|
||||
virtual ~NodeMetadata();
|
||||
|
@ -70,11 +71,12 @@ public:
|
|||
virtual std::string getText(){ return ""; }
|
||||
virtual void setText(const std::string &t){}
|
||||
protected:
|
||||
static void registerType(u16 id, const std::string &name, Factory f);
|
||||
static void registerType(u16 id, const std::string &name, Factory f,
|
||||
Factory2 f2);
|
||||
IGameDef *m_gamedef;
|
||||
private:
|
||||
static core::map<u16, Factory> m_types;
|
||||
static core::map<std::string, Factory> m_names;
|
||||
static core::map<std::string, Factory2> m_names;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue