src/ai/ai.h
author truebrain
Mon, 30 Jun 2008 12:15:10 +0000
branchnoai
changeset 11097 6967c52c78c5
parent 10891 5ebb6f9068d0
child 11098 37d15a8951b8
permissions -rw-r--r--
(svn r13654) [NoAI] -Change [API CHANGE]: moved AISetting::SetCommandDelay to AIController::SetCommandDelay, as it was silly to have it in a seperate class, while it was part of the controller.
9360
c20d0a9e0a5c (svn r9142) [NoAI] -Add: added initial code for AI-layer system
truelight
parents: 9359
diff changeset
     1
/* $Id$ */
c20d0a9e0a5c (svn r9142) [NoAI] -Add: added initial code for AI-layer system
truelight
parents: 9359
diff changeset
     2
10455
22c441f5adf9 (svn r12997) [NoAI] -Sync: with trunk r12895:12996.
rubidium
parents: 9682
diff changeset
     3
/** @file ai.h Base functions for all AIs. */
9360
c20d0a9e0a5c (svn r9142) [NoAI] -Add: added initial code for AI-layer system
truelight
parents: 9359
diff changeset
     4
2395
19b4da30806b (svn r2921) -Codechange: moved all AI-code to 1 central place (ai/ai.c)
truelight
parents:
diff changeset
     5
#ifndef AI_H
19b4da30806b (svn r2921) -Codechange: moved all AI-code to 1 central place (ai/ai.c)
truelight
parents:
diff changeset
     6
#define AI_H
19b4da30806b (svn r2921) -Codechange: moved all AI-code to 1 central place (ai/ai.c)
truelight
parents:
diff changeset
     7
9682
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9467
diff changeset
     8
#include "api/ai_event_types.hpp"
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9467
diff changeset
     9
10740
325e94c419ac (svn r13290) [NoAI] -Fix: do not activate a new player when no suitable AI can be found to start it. Also, when loading a savegame, do not consider a player as AI if no suitable AI can be found for it.
glx
parents: 10718
diff changeset
    10
bool AI_StartNewAI(PlayerID player);
2551
436aaaa22ba5 (svn r3080) byte -> PlayerID, int -> EngineID, -1 -> INVALID_ENGINE
tron
parents: 2395
diff changeset
    11
void AI_PlayerDied(PlayerID player);
6573
7624f942237f (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 5726
diff changeset
    12
void AI_RunGameLoop();
7624f942237f (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 5726
diff changeset
    13
void AI_Initialize();
10718
7e9d9e40e16f (svn r13268) [NoAI] -Fix: kill AIs on game abortion
glx
parents: 10643
diff changeset
    14
void AI_KillAll();
6573
7624f942237f (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 5726
diff changeset
    15
void AI_Uninitialize();
9360
c20d0a9e0a5c (svn r9142) [NoAI] -Add: added initial code for AI-layer system
truelight
parents: 9359
diff changeset
    16
bool AI_AllowNewAI();
9467
730cae121ae3 (svn r9305) [NoAI] -Add: option to force-select an AI from the console.
rubidium
parents: 9444
diff changeset
    17
void AI_ForceAI(const char *forced_ai);
9682
d031eb183733 (svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents: 9467
diff changeset
    18
void AI_Event(PlayerID player, AIEvent *event);
10643
970417eef395 (svn r13187) [NoAI] -Codechange: rewrote the AI register part; C++ AIs are completely impossible now, and registration happens directly via AISquirrel. This cleans up the registration flow, and makes everything readable again, as sure I made a mess out of it :)
truebrain
parents: 10455
diff changeset
    19
char *AI_GetConsoleList(char *p, const char *last);
10889
ecb77cfc4a10 (svn r13440) [NoAI] -Add: introducing ai/library, a method to load libraries into your AI.
truebrain
parents: 10740
diff changeset
    20
bool AI_ImportLibrary(const char *library, const char *class_name, int version, HSQUIRRELVM vm);
10891
5ebb6f9068d0 (svn r13442) [NoAI] -Add: added 'rescan_ai' console command. Use it to rescan the ai dir when you add AIs or libraries without needing to exit and restart openttd.
glx
parents: 10889
diff changeset
    21
void AI_Rescan();
2395
19b4da30806b (svn r2921) -Codechange: moved all AI-code to 1 central place (ai/ai.c)
truelight
parents:
diff changeset
    22
9441
03da911c8d5f (svn r9255) [NoAI] -Add: each AI now runs in a seperate thread. The main thread is suspended if any AI thread is running, only one AI thread runs at the time.
truelight
parents: 9427
diff changeset
    23
void CcAI(bool success, TileIndex tile, uint32 p1, uint32 p2);
03da911c8d5f (svn r9255) [NoAI] -Add: each AI now runs in a seperate thread. The main thread is suspended if any AI thread is running, only one AI thread runs at the time.
truelight
parents: 9427
diff changeset
    24
2395
19b4da30806b (svn r2921) -Codechange: moved all AI-code to 1 central place (ai/ai.c)
truelight
parents:
diff changeset
    25
#endif /* AI_H */