src/ai/core/ai_controller.hpp
author truelight
Thu, 15 Mar 2007 19:33:07 +0000
branchnoai
changeset 9422 33efcc5f1b09
parent 9404 ef9e171617a3
child 9425 8eec6d10844a
permissions -rw-r--r--
(svn r9223) [NoAI] -Change: moved squirrel/engine.cpp to squirrel.cpp in root
-Change: renamed SquirrelEngine to Squirrel
/* $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(Squirrel *engine) {
	DefSQClass <AIControllerSquirrel> SQAIController("AIController");
	SQAIController.PreRegister(engine);
	SQAIController.DefSQFunction(engine, &AIControllerSquirrel::GetTick, "GetTick");
	SQAIController.PostRegister(engine);
}
#endif /* SQUIRREL_CLASS */