src/ai/ai.h
changeset 10207 c291a21b304e
parent 9413 7042a8ec3fa8
equal deleted inserted replaced
10206:0050610c0368 10207:c291a21b304e
    22 	uint uid;
    22 	uint uid;
    23 
    23 
    24 	AICommand *next;
    24 	AICommand *next;
    25 };
    25 };
    26 
    26 
    27 /* The struct for an AIScript Player */
    27 /* The struct for an AIScript Company */
    28 struct AIPlayer {
    28 struct AICompany {
    29 	bool active;            ///< Is this AI active?
    29 	bool active;            ///< Is this AI active?
    30 	AICommand *queue;       ///< The commands that he has in his queue
    30 	AICommand *queue;       ///< The commands that he has in his queue
    31 	AICommand *queue_tail;  ///< The tail of this queue
    31 	AICommand *queue_tail;  ///< The tail of this queue
    32 };
    32 };
    33 
    33 
    37 	bool enabled;           ///< Is AI enabled?
    37 	bool enabled;           ///< Is AI enabled?
    38 	uint tick;              ///< The current tick (something like _frame_counter, only for AIs)
    38 	uint tick;              ///< The current tick (something like _frame_counter, only for AIs)
    39 };
    39 };
    40 
    40 
    41 extern AIStruct _ai;
    41 extern AIStruct _ai;
    42 extern AIPlayer _ai_player[MAX_PLAYERS];
    42 extern AICompany _ai_company[MAX_COMPANIES];
    43 
    43 
    44 // ai.c
    44 // ai.c
    45 void AI_StartNewAI(PlayerID player);
    45 void AI_StartNewAI(CompanyID company);
    46 void AI_PlayerDied(PlayerID player);
    46 void AI_CompanyDied(CompanyID company);
    47 void AI_RunGameLoop();
    47 void AI_RunGameLoop();
    48 void AI_Initialize();
    48 void AI_Initialize();
    49 void AI_Uninitialize();
    49 void AI_Uninitialize();
    50 CommandCost AI_DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);
    50 CommandCost AI_DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);
    51 CommandCost AI_DoCommandCc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc, CommandCallback* callback);
    51 CommandCost AI_DoCommandCc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc, CommandCallback* callback);