src/ai/api/ai_event.hpp
branchnoai
changeset 9829 80fbe02a4184
parent 9823 0b7f816cf46f
child 9843 29f34a179daf
equal deleted inserted replaced
9828:38be66875b45 9829:80fbe02a4184
     1 /* $Id$ */
     1 /* $Id$ */
     2 
     2 
     3 /** @file ai_event.hpp Everything to handle events from the game */
     3 /** @file ai_event.hpp Everything to handle events from the game. */
     4 
     4 
     5 #ifndef AI_EVENT_HPP
     5 #ifndef AI_EVENT_HPP
     6 #define AI_EVENT_HPP
     6 #define AI_EVENT_HPP
     7 
     7 
     8 #include "ai_object.hpp"
     8 #include "ai_object.hpp"
     9 
     9 
    10 /**
    10 /**
    11  * A single event that can be triggered by the game.
    11  * Class that handles all event related functions.
    12  * You can lookup the type, and than convert it to the real event-class.
    12  * You can lookup the type, and than convert it to the real event-class.
    13  * That way you can request more detailed information about the event.
    13  * That way you can request more detailed information about the event.
    14  */
    14  */
    15 class AIEvent : public AIObject {
    15 class AIEvent : public AIObject {
    16 public:
    16 public:
       
    17 	static const char *GetClassName() { return "AIEvent"; }
       
    18 
    17 	/**
    19 	/**
    18 	 * The type of event. Needed to lookup the detailed class.
    20 	 * The type of event. Needed to lookup the detailed class.
    19 	 */
    21 	 */
    20 	enum AIEventType {
    22 	enum AIEventType {
    21 		AI_ET_INVALID = 0,
    23 		AI_ET_INVALID = 0,
    33 
    35 
    34 	/**
    36 	/**
    35 	 * Get the event-type.
    37 	 * Get the event-type.
    36 	 */
    38 	 */
    37 	AIEventType GetEventType() { return this->type; }
    39 	AIEventType GetEventType() { return this->type; }
    38 
       
    39 	/**
       
    40 	 * The name of the class, needed by several sub-processes.
       
    41 	 */
       
    42 	static const char *GetClassName() { return "AIEvent"; }
       
    43 
    40 
    44 protected:
    41 protected:
    45 	/**
    42 	/**
    46 	 * The type of this event.
    43 	 * The type of this event.
    47 	 */
    44 	 */