--- a/src/ai/api/ai_controller.hpp Fri Mar 16 10:14:14 2007 +0000
+++ b/src/ai/api/ai_controller.hpp Fri Mar 16 17:03:49 2007 +0000
@@ -19,9 +19,9 @@
virtual ~AIController() { }
/**
- * This function is called every tick.
+ * This function is called once to start the AI.
*/
- virtual void GameLoop() = 0;
+ virtual void Start() = 0;
/**
* Increase the internal ticker.
@@ -32,6 +32,13 @@
* Return the value of the ticker.
*/
uint GetTick() { return this->tick; }
+
+ /**
+ * Sleep for X ticks. The code continues after this line when the X AI ticks
+ * are passed. Mind that an AI tick is different from in-game ticks and
+ * differ per AI speed.
+ */
+ void Sleep(uint ticks);
};
#endif /* AI_CONTROLLER_HPP */
@@ -53,6 +60,7 @@
DefSQClass <AIControllerSquirrel> SQAIController("AIController");
SQAIController.PreRegister(engine);
SQAIController.DefSQFunction(engine, &AIControllerSquirrel::GetTick, "GetTick");
+ SQAIController.DefSQFunction(engine, &AIControllerSquirrel::Sleep, "Sleep");
SQAIController.PostRegister(engine);
}
#endif /* SQUIRREL_CLASS */