dfhack/plugins/Dfusion/include/lua_Misc.h

46 lines
804 B
C

2011-08-04 12:52:22 -06:00
#ifndef LUA_MISC_H
#define LUA_MISC_H
#include <map>
2011-12-31 04:48:42 -07:00
#include "Core.h"
#include <MemAccess.h>
2011-08-04 12:52:22 -06:00
#include "luamain.h"
#include "OutFile.h"
#include "LuaTools.h"
2011-08-04 12:52:22 -06:00
namespace lua
{
typedef std::map<std::string,void *> mapPlugs;
class PlugManager
{
public:
mapPlugs GetList(){return plugs;};
uint32_t AddNewPlug(std::string name,uint32_t size,uint32_t loc=0);
uint32_t FindPlugin(std::string name);
static PlugManager &GetInst()
{
void *p;
p=DFHack::Core::getInstance().GetData("dfusion_manager");
if(p==0)
{
p=new PlugManager;
DFHack::Core::getInstance().RegisterData(p,"dfusion_manager");
}
return *static_cast<PlugManager*>(p);
};
protected:
private:
PlugManager(){};
mapPlugs plugs;
};
2011-08-04 12:52:22 -06:00
void RegisterMisc(lua::state &st);
}
#endif