author | truebrain |
Mon, 31 Mar 2008 06:32:27 +0000 | |
branch | noai |
changeset 9829 | 80fbe02a4184 |
parent 9814 | be51ea0adc29 |
child 9837 | c9ec4f82e0d0 |
permissions | -rw-r--r-- |
9361
7bb2bd22b16e
(svn r9144) [NoAI] -Change: moved command functions to AIObject, and made AIBase depend on AIObject
truelight
parents:
diff
changeset
|
1 |
/* $Id$ */ |
7bb2bd22b16e
(svn r9144) [NoAI] -Change: moved command functions to AIObject, and made AIBase depend on AIObject
truelight
parents:
diff
changeset
|
2 |
|
9829
80fbe02a4184
(svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents:
9814
diff
changeset
|
3 |
/** @file ai_object.hpp Main object, on which all objects depend. */ |
9361
7bb2bd22b16e
(svn r9144) [NoAI] -Change: moved command functions to AIObject, and made AIBase depend on AIObject
truelight
parents:
diff
changeset
|
4 |
|
7bb2bd22b16e
(svn r9144) [NoAI] -Change: moved command functions to AIObject, and made AIBase depend on AIObject
truelight
parents:
diff
changeset
|
5 |
#ifndef AI_OBJECT_HPP |
7bb2bd22b16e
(svn r9144) [NoAI] -Change: moved command functions to AIObject, and made AIBase depend on AIObject
truelight
parents:
diff
changeset
|
6 |
#define AI_OBJECT_HPP |
7bb2bd22b16e
(svn r9144) [NoAI] -Change: moved command functions to AIObject, and made AIBase depend on AIObject
truelight
parents:
diff
changeset
|
7 |
|
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
|
8 |
#include "../../stdafx.h" |
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
|
9 |
#include "../../functions.h" |
9679
788e083db48b
(svn r10625) [NoAI] -Fix: returning C++ classes, by creating a temp SQ class, had its problems, this should fix them all (double-frees, wrong scope, ..)
truelight
parents:
9629
diff
changeset
|
10 |
#include "../../misc/countedptr.hpp" |
9361
7bb2bd22b16e
(svn r9144) [NoAI] -Change: moved command functions to AIObject, and made AIBase depend on AIObject
truelight
parents:
diff
changeset
|
11 |
|
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9760
diff
changeset
|
12 |
#ifndef _SQUIRREL_H_ |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9760
diff
changeset
|
13 |
/* Life becomes easier when we can tell about a function it needs the VM, but |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9760
diff
changeset
|
14 |
* without really including 'squirrel.h'. */ |
9829
80fbe02a4184
(svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents:
9814
diff
changeset
|
15 |
typedef void *HSQUIRRELVM; |
9814
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9760
diff
changeset
|
16 |
typedef int SQInteger; |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9760
diff
changeset
|
17 |
#endif |
be51ea0adc29
(svn r12411) [NoAI] -Change [API CHANGE]: order of params of CargoIncome is changed
truebrain
parents:
9760
diff
changeset
|
18 |
|
9475
58c20c0e394f
(svn r9320) [NoAI] -Fix: added some doxygen comments to make doxygen happy
truelight
parents:
9473
diff
changeset
|
19 |
/** |
58c20c0e394f
(svn r9320) [NoAI] -Fix: added some doxygen comments to make doxygen happy
truelight
parents:
9473
diff
changeset
|
20 |
* The callback function for Mode-classes. |
58c20c0e394f
(svn r9320) [NoAI] -Fix: added some doxygen comments to make doxygen happy
truelight
parents:
9473
diff
changeset
|
21 |
*/ |
9629 | 22 |
typedef bool (AIModeProc)(TileIndex tile, uint32 p1, uint32 p2, uint procc, CommandCost costs); |
9450
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
23 |
|
9448
2a4c4340233d
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
truelight
parents:
9441
diff
changeset
|
24 |
/** |
2a4c4340233d
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
truelight
parents:
9441
diff
changeset
|
25 |
* Uper-parent object of all API classes. You should never use this class in |
2a4c4340233d
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
truelight
parents:
9441
diff
changeset
|
26 |
* your AI, as it doesn't publish any public functions. It is used |
2a4c4340233d
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
truelight
parents:
9441
diff
changeset
|
27 |
* internally to have a common place to handle general things, like internal |
2a4c4340233d
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
truelight
parents:
9441
diff
changeset
|
28 |
* command processing, and command-validation checks. |
2a4c4340233d
(svn r9273) [NoAI] -Documentation: finished documenting the last few files; they should now be readable for any non-programmer.
truelight
parents:
9441
diff
changeset
|
29 |
*/ |
9679
788e083db48b
(svn r10625) [NoAI] -Fix: returning C++ classes, by creating a temp SQ class, had its problems, this should fix them all (double-frees, wrong scope, ..)
truelight
parents:
9629
diff
changeset
|
30 |
class AIObject : public SimpleCountedObject { |
9450
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
31 |
private: |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
32 |
struct AIDoCommandStruct { |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
33 |
AIModeProc *mode; |
9473
dcbcd1c4496d
(svn r9318) [NoAI] -Add: added new param in ModeCallback: costs
truelight
parents:
9454
diff
changeset
|
34 |
AIObject *mode_instance; |
9450
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
35 |
uint delay; |
9629 | 36 |
CommandCost costs; |
9760
265fdd2130c3
(svn r12248) [NoAI] -Codechange: last_command_res was in AIThread, while it should be in AIObject, like all other variables like it
truebrain
parents:
9695
diff
changeset
|
37 |
bool last_command_res; |
9496
05ebee9884b3
(svn r9368) [NoAI] -Fix: store _new_vehicle_id directly after successful handling the command in a per-AI-player-safe piece of memory, so we can restore the value when ever we want later in the process
truelight
parents:
9486
diff
changeset
|
38 |
VehicleID new_vehicle_id; |
9511 | 39 |
SignID new_sign_id; |
9680
5ed7bbfd51c7
(svn r10629) [NoAI] -Fix: on returning a class instance which is NULL, do not make a wrapper SQ, but return a NULL pointer too
truelight
parents:
9679
diff
changeset
|
40 |
void *event_data; |
9450
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
41 |
}; |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
42 |
|
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
43 |
/** |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
44 |
* The current mode of the AI players. |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
45 |
*/ |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
46 |
static AIDoCommandStruct *GetDoCommandStruct(PlayerID player); |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
47 |
|
9361
7bb2bd22b16e
(svn r9144) [NoAI] -Change: moved command functions to AIObject, and made AIBase depend on AIObject
truelight
parents:
diff
changeset
|
48 |
protected: |
7bb2bd22b16e
(svn r9144) [NoAI] -Change: moved command functions to AIObject, and made AIBase depend on AIObject
truelight
parents:
diff
changeset
|
49 |
/** |
7bb2bd22b16e
(svn r9144) [NoAI] -Change: moved command functions to AIObject, and made AIBase depend on AIObject
truelight
parents:
diff
changeset
|
50 |
* Executes a raw DoCommand for the AI. |
7bb2bd22b16e
(svn r9144) [NoAI] -Change: moved command functions to AIObject, and made AIBase depend on AIObject
truelight
parents:
diff
changeset
|
51 |
*/ |
9695
708f1e3cc4c4
(svn r10936) [NoAI] -Fix: allow water_protection for non-water-building in DoCommand
truelight
parents:
9682
diff
changeset
|
52 |
static bool DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint procc, bool water_protection = true); |
9414
a7f7bbec08da
(svn r9212) [NoAI] -Add: added CmdFailed and CmdSucceeded in AIObject() and used it
truelight
parents:
9388
diff
changeset
|
53 |
|
a7f7bbec08da
(svn r9212) [NoAI] -Add: added CmdFailed and CmdSucceeded in AIObject() and used it
truelight
parents:
9388
diff
changeset
|
54 |
/** |
9452
4c5eedbc3ba9
(svn r9282) [NoAI] -Add: added AIAccounting, which tracks the cost of your buying/selling.
truelight
parents:
9450
diff
changeset
|
55 |
* Sets the DoCommand costs counter to a value. |
9414
a7f7bbec08da
(svn r9212) [NoAI] -Add: added CmdFailed and CmdSucceeded in AIObject() and used it
truelight
parents:
9388
diff
changeset
|
56 |
*/ |
9629 | 57 |
static void SetDoCommandCosts(Money value); |
9414
a7f7bbec08da
(svn r9212) [NoAI] -Add: added CmdFailed and CmdSucceeded in AIObject() and used it
truelight
parents:
9388
diff
changeset
|
58 |
|
a7f7bbec08da
(svn r9212) [NoAI] -Add: added CmdFailed and CmdSucceeded in AIObject() and used it
truelight
parents:
9388
diff
changeset
|
59 |
/** |
9452
4c5eedbc3ba9
(svn r9282) [NoAI] -Add: added AIAccounting, which tracks the cost of your buying/selling.
truelight
parents:
9450
diff
changeset
|
60 |
* Increase the current value of the DoCommand costs counter. |
9414
a7f7bbec08da
(svn r9212) [NoAI] -Add: added CmdFailed and CmdSucceeded in AIObject() and used it
truelight
parents:
9388
diff
changeset
|
61 |
*/ |
9629 | 62 |
static void IncreaseDoCommandCosts(Money value); |
9452
4c5eedbc3ba9
(svn r9282) [NoAI] -Add: added AIAccounting, which tracks the cost of your buying/selling.
truelight
parents:
9450
diff
changeset
|
63 |
|
4c5eedbc3ba9
(svn r9282) [NoAI] -Add: added AIAccounting, which tracks the cost of your buying/selling.
truelight
parents:
9450
diff
changeset
|
64 |
/** |
4c5eedbc3ba9
(svn r9282) [NoAI] -Add: added AIAccounting, which tracks the cost of your buying/selling.
truelight
parents:
9450
diff
changeset
|
65 |
* Get the current DoCommand costs counter. |
4c5eedbc3ba9
(svn r9282) [NoAI] -Add: added AIAccounting, which tracks the cost of your buying/selling.
truelight
parents:
9450
diff
changeset
|
66 |
*/ |
9629 | 67 |
static Money GetDoCommandCosts(); |
9450
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
68 |
|
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
69 |
/** |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
70 |
* Set the current mode of your AI to this proc. |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
71 |
*/ |
9473
dcbcd1c4496d
(svn r9318) [NoAI] -Add: added new param in ModeCallback: costs
truelight
parents:
9454
diff
changeset
|
72 |
static void SetDoCommandMode(AIModeProc *proc, AIObject *instance); |
9450
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
73 |
|
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
74 |
/** |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
75 |
* Get the current mode your AI is currently under. |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
76 |
*/ |
9473
dcbcd1c4496d
(svn r9318) [NoAI] -Add: added new param in ModeCallback: costs
truelight
parents:
9454
diff
changeset
|
77 |
static AIModeProc *GetDoCommandMode(); |
dcbcd1c4496d
(svn r9318) [NoAI] -Add: added new param in ModeCallback: costs
truelight
parents:
9454
diff
changeset
|
78 |
|
dcbcd1c4496d
(svn r9318) [NoAI] -Add: added new param in ModeCallback: costs
truelight
parents:
9454
diff
changeset
|
79 |
/** |
dcbcd1c4496d
(svn r9318) [NoAI] -Add: added new param in ModeCallback: costs
truelight
parents:
9454
diff
changeset
|
80 |
* Get the instance of the current mode your AI is currently under. |
dcbcd1c4496d
(svn r9318) [NoAI] -Add: added new param in ModeCallback: costs
truelight
parents:
9454
diff
changeset
|
81 |
*/ |
dcbcd1c4496d
(svn r9318) [NoAI] -Add: added new param in ModeCallback: costs
truelight
parents:
9454
diff
changeset
|
82 |
static AIObject *GetDoCommandModeInstance(); |
9450
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
83 |
|
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
84 |
/** |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
85 |
* Set the delay of the DoCommand. |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
86 |
*/ |
9473
dcbcd1c4496d
(svn r9318) [NoAI] -Add: added new param in ModeCallback: costs
truelight
parents:
9454
diff
changeset
|
87 |
static void SetDoCommandDelay(uint ticks); |
9450
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
88 |
|
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
89 |
/** |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
90 |
* Get the delay of the DoCommand. |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
9448
diff
changeset
|
91 |
*/ |
9473
dcbcd1c4496d
(svn r9318) [NoAI] -Add: added new param in ModeCallback: costs
truelight
parents:
9454
diff
changeset
|
92 |
static uint GetDoCommandDelay(); |
9454
ee6a65b37b82
(svn r9284) [NoAI] -Fix: reset internal static AIObject data per AI on AI startup
truelight
parents:
9452
diff
changeset
|
93 |
|
9496
05ebee9884b3
(svn r9368) [NoAI] -Fix: store _new_vehicle_id directly after successful handling the command in a per-AI-player-safe piece of memory, so we can restore the value when ever we want later in the process
truelight
parents:
9486
diff
changeset
|
94 |
/** |
9760
265fdd2130c3
(svn r12248) [NoAI] -Codechange: last_command_res was in AIThread, while it should be in AIObject, like all other variables like it
truebrain
parents:
9695
diff
changeset
|
95 |
* Get the latest result of a DoCommand. |
265fdd2130c3
(svn r12248) [NoAI] -Codechange: last_command_res was in AIThread, while it should be in AIObject, like all other variables like it
truebrain
parents:
9695
diff
changeset
|
96 |
*/ |
265fdd2130c3
(svn r12248) [NoAI] -Codechange: last_command_res was in AIThread, while it should be in AIObject, like all other variables like it
truebrain
parents:
9695
diff
changeset
|
97 |
static bool GetLastCommandRes(); |
265fdd2130c3
(svn r12248) [NoAI] -Codechange: last_command_res was in AIThread, while it should be in AIObject, like all other variables like it
truebrain
parents:
9695
diff
changeset
|
98 |
|
265fdd2130c3
(svn r12248) [NoAI] -Codechange: last_command_res was in AIThread, while it should be in AIObject, like all other variables like it
truebrain
parents:
9695
diff
changeset
|
99 |
/** |
9496
05ebee9884b3
(svn r9368) [NoAI] -Fix: store _new_vehicle_id directly after successful handling the command in a per-AI-player-safe piece of memory, so we can restore the value when ever we want later in the process
truelight
parents:
9486
diff
changeset
|
100 |
* Get the latest stored new_vehicle_id. |
05ebee9884b3
(svn r9368) [NoAI] -Fix: store _new_vehicle_id directly after successful handling the command in a per-AI-player-safe piece of memory, so we can restore the value when ever we want later in the process
truelight
parents:
9486
diff
changeset
|
101 |
*/ |
05ebee9884b3
(svn r9368) [NoAI] -Fix: store _new_vehicle_id directly after successful handling the command in a per-AI-player-safe piece of memory, so we can restore the value when ever we want later in the process
truelight
parents:
9486
diff
changeset
|
102 |
static VehicleID GetNewVehicleID(); |
05ebee9884b3
(svn r9368) [NoAI] -Fix: store _new_vehicle_id directly after successful handling the command in a per-AI-player-safe piece of memory, so we can restore the value when ever we want later in the process
truelight
parents:
9486
diff
changeset
|
103 |
|
9511 | 104 |
/** |
105 |
* Get the latest stored new_sign_id. |
|
106 |
*/ |
|
107 |
static SignID GetNewSignID(); |
|
108 |
||
9680
5ed7bbfd51c7
(svn r10629) [NoAI] -Fix: on returning a class instance which is NULL, do not make a wrapper SQ, but return a NULL pointer too
truelight
parents:
9679
diff
changeset
|
109 |
/** |
5ed7bbfd51c7
(svn r10629) [NoAI] -Fix: on returning a class instance which is NULL, do not make a wrapper SQ, but return a NULL pointer too
truelight
parents:
9679
diff
changeset
|
110 |
* Get the pointer to store event data in. |
5ed7bbfd51c7
(svn r10629) [NoAI] -Fix: on returning a class instance which is NULL, do not make a wrapper SQ, but return a NULL pointer too
truelight
parents:
9679
diff
changeset
|
111 |
*/ |
9682
d031eb183733
(svn r10631) [NoAI] -Add: AIEvent, to take care of events; for now it only reports when vehicles are crashed
truelight
parents:
9680
diff
changeset
|
112 |
static void *&GetEventPointer(); |
9680
5ed7bbfd51c7
(svn r10629) [NoAI] -Fix: on returning a class instance which is NULL, do not make a wrapper SQ, but return a NULL pointer too
truelight
parents:
9679
diff
changeset
|
113 |
|
9454
ee6a65b37b82
(svn r9284) [NoAI] -Fix: reset internal static AIObject data per AI on AI startup
truelight
parents:
9452
diff
changeset
|
114 |
public: |
ee6a65b37b82
(svn r9284) [NoAI] -Fix: reset internal static AIObject data per AI on AI startup
truelight
parents:
9452
diff
changeset
|
115 |
/** |
9760
265fdd2130c3
(svn r12248) [NoAI] -Codechange: last_command_res was in AIThread, while it should be in AIObject, like all other variables like it
truebrain
parents:
9695
diff
changeset
|
116 |
* Store the latest result of a DoCommand per player. |
265fdd2130c3
(svn r12248) [NoAI] -Codechange: last_command_res was in AIThread, while it should be in AIObject, like all other variables like it
truebrain
parents:
9695
diff
changeset
|
117 |
* @note NEVER use this yourself in your AI! |
265fdd2130c3
(svn r12248) [NoAI] -Codechange: last_command_res was in AIThread, while it should be in AIObject, like all other variables like it
truebrain
parents:
9695
diff
changeset
|
118 |
*/ |
265fdd2130c3
(svn r12248) [NoAI] -Codechange: last_command_res was in AIThread, while it should be in AIObject, like all other variables like it
truebrain
parents:
9695
diff
changeset
|
119 |
static void SetLastCommandRes(bool res); |
265fdd2130c3
(svn r12248) [NoAI] -Codechange: last_command_res was in AIThread, while it should be in AIObject, like all other variables like it
truebrain
parents:
9695
diff
changeset
|
120 |
|
265fdd2130c3
(svn r12248) [NoAI] -Codechange: last_command_res was in AIThread, while it should be in AIObject, like all other variables like it
truebrain
parents:
9695
diff
changeset
|
121 |
/** |
9496
05ebee9884b3
(svn r9368) [NoAI] -Fix: store _new_vehicle_id directly after successful handling the command in a per-AI-player-safe piece of memory, so we can restore the value when ever we want later in the process
truelight
parents:
9486
diff
changeset
|
122 |
* Store a new_vehicle_id per player. |
05ebee9884b3
(svn r9368) [NoAI] -Fix: store _new_vehicle_id directly after successful handling the command in a per-AI-player-safe piece of memory, so we can restore the value when ever we want later in the process
truelight
parents:
9486
diff
changeset
|
123 |
* @note NEVER use this yourself in your AI! |
05ebee9884b3
(svn r9368) [NoAI] -Fix: store _new_vehicle_id directly after successful handling the command in a per-AI-player-safe piece of memory, so we can restore the value when ever we want later in the process
truelight
parents:
9486
diff
changeset
|
124 |
*/ |
05ebee9884b3
(svn r9368) [NoAI] -Fix: store _new_vehicle_id directly after successful handling the command in a per-AI-player-safe piece of memory, so we can restore the value when ever we want later in the process
truelight
parents:
9486
diff
changeset
|
125 |
static void SetNewVehicleID(VehicleID vehicle); |
05ebee9884b3
(svn r9368) [NoAI] -Fix: store _new_vehicle_id directly after successful handling the command in a per-AI-player-safe piece of memory, so we can restore the value when ever we want later in the process
truelight
parents:
9486
diff
changeset
|
126 |
|
05ebee9884b3
(svn r9368) [NoAI] -Fix: store _new_vehicle_id directly after successful handling the command in a per-AI-player-safe piece of memory, so we can restore the value when ever we want later in the process
truelight
parents:
9486
diff
changeset
|
127 |
/** |
9511 | 128 |
* Store a new_sign_id per player. |
129 |
* @note NEVER use this yourself in your AI! |
|
130 |
*/ |
|
131 |
static void SetNewSignID(SignID vehicle); |
|
132 |
||
133 |
/** |
|
9454
ee6a65b37b82
(svn r9284) [NoAI] -Fix: reset internal static AIObject data per AI on AI startup
truelight
parents:
9452
diff
changeset
|
134 |
* If an AI starts, some internals needs to be resetted. This function |
ee6a65b37b82
(svn r9284) [NoAI] -Fix: reset internal static AIObject data per AI on AI startup
truelight
parents:
9452
diff
changeset
|
135 |
* takes care of that. |
9496
05ebee9884b3
(svn r9368) [NoAI] -Fix: store _new_vehicle_id directly after successful handling the command in a per-AI-player-safe piece of memory, so we can restore the value when ever we want later in the process
truelight
parents:
9486
diff
changeset
|
136 |
* @note NEVER use this yourself in your AI! |
9454
ee6a65b37b82
(svn r9284) [NoAI] -Fix: reset internal static AIObject data per AI on AI startup
truelight
parents:
9452
diff
changeset
|
137 |
*/ |
ee6a65b37b82
(svn r9284) [NoAI] -Fix: reset internal static AIObject data per AI on AI startup
truelight
parents:
9452
diff
changeset
|
138 |
static void ResetInternalPlayerData(); |
9361
7bb2bd22b16e
(svn r9144) [NoAI] -Change: moved command functions to AIObject, and made AIBase depend on AIObject
truelight
parents:
diff
changeset
|
139 |
}; |
7bb2bd22b16e
(svn r9144) [NoAI] -Change: moved command functions to AIObject, and made AIBase depend on AIObject
truelight
parents:
diff
changeset
|
140 |
|
7bb2bd22b16e
(svn r9144) [NoAI] -Change: moved command functions to AIObject, and made AIBase depend on AIObject
truelight
parents:
diff
changeset
|
141 |
#endif /* AI_OBJECT_HPP */ |