Research Article
Artificial Intelligence in Video Games: Towards a Unified Framework
Algorithm 10
The controller interface of a CptMvAgent2D. These functions are used by the CptMvAgent2D class to relay events to the AI.
class CptMvAgent2D_Controller | { | protected: | CptMvAgent2D m_pOwner; | public: | virtual CptMvAgent2D_Controller() | //Called when a bot is killed by an opponent | virtual void KilledBy_Handler(CptMvAgent2D attacker) = 0; | //Called when a bot hears a gunshot | virtual void HeardSound_Handler(CptMvAgent2D source) = 0; | //Called when the player removes a bot from the game | virtual void BotRemoved_Handler(CptMvAgent2D bot) = 0; | //Called when the player takes control of a bot | virtual void Suspend() = 0; | //Called when the player hands back control to a bot | virtual void Resume() = 0; | //Called every game update cycle | virtual void Update() = 0; | }; |
|