1
/* $Id: ai_event.hpp 15684 2009-03-12 11:43:40Z yexo $ */
3
/** @file ai_event.hpp Everything to handle events from the game. */
8
#include "ai_object.hpp"
11
* Class that handles all event related functions.
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.
15
class AIEvent : public AIObject {
17
static const char *GetClassName() { return "AIEvent"; }
20
* The type of event. Needed to lookup the detailed class.
26
AI_ET_SUBSIDY_OFFER_EXPIRED,
27
AI_ET_SUBSIDY_AWARDED,
28
AI_ET_SUBSIDY_EXPIRED,
31
AI_ET_COMPANY_IN_TROUBLE,
33
AI_ET_COMPANY_BANKRUPT,
34
AI_ET_VEHICLE_CRASHED,
36
AI_ET_VEHICLE_WAITING_IN_DEPOT,
37
AI_ET_VEHICLE_UNPROFITABLE,
40
AI_ET_ENGINE_AVAILABLE,
41
AI_ET_STATION_FIRST_VEHICLE,
42
AI_ET_DISASTER_ZEPPELINER_CRASHED,
43
AI_ET_DISASTER_ZEPPELINER_CLEARED,
47
* Constructor of AIEvent, to get the type of event.
49
AIEvent(AIEvent::AIEventType type) :
55
* @return The @c AIEventType.
57
AIEventType GetEventType() { return this->type; }
61
* The type of this event.
67
* Class that handles all event related functions.
68
* @note it is not needed to create an instance of AIEvent to access it, as
69
* all members are static, and all data is stored AI-wide.
71
class AIEventController : public AIObject {
74
* The name of the class, needed by several sub-processes.
76
static const char *GetClassName() { return "AIEventController"; }
79
* Check if there is an event waiting.
80
* @return true if there is an event on the stack.
82
static bool IsEventWaiting();
86
* @return a class of the event-child issues.
88
static AIEvent *GetNextEvent();
92
* Insert an event to the queue for the company.
93
* @param event The event to insert.
94
* @note DO NOT CALL YOURSELF; leave it to the internal AI programming.
96
static void InsertEvent(AIEvent *event);
99
* Free the event pointer.
100
* @note DO NOT CALL YOURSELF; leave it to the internal AI programming.
102
static void FreeEventPointer();
103
#endif /* EXPORT_SKIP */
107
* Create the event pointer.
109
static void CreateEventPointer();
112
#endif /* AI_EVENT_HPP */