summaryrefslogblamecommitdiffstats
path: root/source/squirrelbindings/cSquirrelBaseClass.h
blob: a66ca7dddf64348b7127fcf7faa10c536830bd6e (plain) (tree)
1
2
3
4
5



                                 
                      























                                                                                                                    
#pragma once
#include "SquirrelBindings.h"
#include "../cPlugin_Squirrel.h"
#include "../cPluginManager.h"
#include "../cRoot.h"

//The baseclass for squirrel plugins
class cSquirrelBaseClass
{
public:
	cSquirrelBaseClass()
		: m_Instance(0)
	{
	}

	void setInstance(cPlugin_Squirrel *a_Instance)
	{
		m_Instance = a_Instance;
	}
	
	void AddHook(short a_Hook)
	{
		if(m_Instance)
			cRoot::Get()->GetPluginManager()->AddHook(m_Instance, (cPluginManager::PluginHook) a_Hook);
	}

protected:
	cPlugin_Squirrel *m_Instance;
};