/* $Id$ */
/** @file squirrel.hpp declarations of the class for squirrel loader */
#ifndef SQUIRREL_HPP
#define SQUIRREL_HPP
#include "../core/ai_controller.hpp"
#include "../core/ai_base.hpp"
#include <squirrel.h>
class Squirrel: public AIController {
private:
HSQUIRRELVM vm; ///< The Virtual Machine for squirrel
HSQOBJECT SQ_instance; ///< The internal instance of squirrel
/**
* Add a single method to a class (in creation) in Squirrel.
*/
void SQAddMethod(const char *name, SQFUNCTION proc, uint nparam, const char *params);
/**
* Registers all our classes, so it can be used from Squirrel.
*/
void RegisterClasses();
/**
* Constructor for Squirrel AIController. We assign the real 'this' value to
* the instance pointer, so we can easy look up this->.
*/
static SQInteger SQConstructor(HSQUIRRELVM vm);
/**
* Destructor for Squirrel AIController. This is called if the class is
* destroyed inside the script.
*/
static SQInteger SQDestructor(SQUserPointer p, SQInteger size);
/**
* A wrapper around the AIController class, as that can't be automated.
*/
static SQInteger SQGetTick(HSQUIRRELVM vm);
public:
Squirrel(const char *script_dir);
~Squirrel();
/* virtual */ void GameLoop();
};
#endif /* SQUIRREL_HPP */