2011-08-04 12:52:22 -06:00
|
|
|
#ifndef LUA_MISC_H
|
|
|
|
#define LUA_MISC_H
|
|
|
|
|
2011-08-04 15:22:25 -06:00
|
|
|
#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"
|
2011-08-04 15:22:25 -06:00
|
|
|
#include "OutFile.h"
|
2011-09-21 12:35:58 -06:00
|
|
|
#include "functioncall.h"
|
2011-08-04 12:52:22 -06:00
|
|
|
|
|
|
|
namespace lua
|
|
|
|
{
|
|
|
|
|
2011-08-04 15:22:25 -06:00
|
|
|
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
|