(svn r9201) [NoAI] -Change: make adding a default-constructor for DefSQClass optional
-Add: added AIFactory code for squirrel. Now scripts can make theirself
known to the core in a simular way as in C++. Just make sure to add
your AIFactory instance to the GLOBAL space!
-Add: even more function in SquirrelEngine
/* $Id$ */
/** @file ai_controler.hpp declaration of class for AIController class */
#ifndef AI_CONTROLLER_HPP
#define AI_CONTROLLER_HPP
#include "../../stdafx.h"
class AIController {
private:
uint tick;
public:
AIController() :
tick(0)
{}
virtual ~AIController() { }
/**
* This function is called every tick.
*/
virtual void GameLoop() = 0;
/**
* Increase the internal ticker.
*/
void IncreaseTick() { this->tick++; }
/**
* Return the value of the ticker.
*/
uint GetTick() { return this->tick; }
};
#endif /* AI_CONTROLLER_HPP */
#ifdef SQUIRREL_CLASS
void SQAIControllerRegister(SquirrelEngine *engine) {
DefSQClass <AIControllerSquirrel> SQAIController("AIController");
SQAIController.PreRegister(engine);
SQAIController.DefSQFunction(engine, &AIControllerSquirrel::GetTick, "GetTick");
SQAIController.PostRegister(engine);
}
#endif /* SQUIRREL_CLASS */