1
0
Fork 0
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:
Perttu Ahola 2011-11-25 16:34:12 +02:00
parent 6a8f9135de
commit 18bb0ea1ea
6 changed files with 188 additions and 51 deletions

View file

@ -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;
};
/*