equal
deleted
inserted
replaced
20 |
20 |
21 /** |
21 /** |
22 * This function is called once to start the AI. |
22 * This function is called once to start the AI. |
23 */ |
23 */ |
24 virtual void Start() = 0; |
24 virtual void Start() = 0; |
|
25 |
|
26 /** |
|
27 * When this function is called, the AI must stop |
|
28 * as soon as possible. It may not call any function |
|
29 * that might suspend, like DoCommand and Sleep. |
|
30 * @note This is only called when the AI is currently |
|
31 * in a suspended state. |
|
32 */ |
|
33 virtual void Stop() = 0; |
25 |
34 |
26 /** |
35 /** |
27 * Increase the internal ticker. |
36 * Increase the internal ticker. |
28 */ |
37 */ |
29 void IncreaseTick() { this->tick++; } |
38 void IncreaseTick() { this->tick++; } |
58 #ifdef DEFINE_SQUIRREL_CLASS |
67 #ifdef DEFINE_SQUIRREL_CLASS |
59 void SQAIControllerRegister(Squirrel *engine) { |
68 void SQAIControllerRegister(Squirrel *engine) { |
60 DefSQClass <AIControllerSquirrel> SQAIController("AIController"); |
69 DefSQClass <AIControllerSquirrel> SQAIController("AIController"); |
61 SQAIController.PreRegister(engine); |
70 SQAIController.PreRegister(engine); |
62 SQAIController.DefSQFunction(engine, &AIControllerSquirrel::GetTick, "GetTick"); |
71 SQAIController.DefSQFunction(engine, &AIControllerSquirrel::GetTick, "GetTick"); |
63 SQAIController.DefSQFunction(engine, &AIControllerSquirrel::Sleep, "Sleep"); |
72 SQAIController.DefSQFunction(engine, &AIControllerSquirrel::Sleep, "Sleep"); |
64 SQAIController.PostRegister(engine); |
73 SQAIController.PostRegister(engine); |
65 } |
74 } |
66 #endif /* SQUIRREL_CLASS */ |
75 #endif /* SQUIRREL_CLASS */ |