author | rubidium |
Sun, 06 Apr 2008 12:26:40 +0000 | |
branch | noai |
changeset 9867 | b7d9ffe24f81 |
parent 9833 | 89a64246458f |
child 10339 | ce6cd68d9eb8 |
permissions | -rw-r--r-- |
9450
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff
changeset
|
1 |
/* $Id$ */ |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff
changeset
|
2 |
|
9833
89a64246458f
(svn r12496) [NoAI] -Documentation: give the .cpp files a nice uniform format too
truebrain
parents:
9629
diff
changeset
|
3 |
/** @file ai_execmode.cpp Implementation of AIExecMode. */ |
9450
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff
changeset
|
4 |
|
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff
changeset
|
5 |
#include "ai_execmode.hpp" |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff
changeset
|
6 |
|
9629 | 7 |
bool AIExecMode::ModeProc(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:
diff
changeset
|
8 |
{ |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff
changeset
|
9 |
/* In execution mode we only return 'true', telling the DoCommand it |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff
changeset
|
10 |
* should continue with the real execution of the command. */ |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff
changeset
|
11 |
return true; |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff
changeset
|
12 |
} |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff
changeset
|
13 |
|
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff
changeset
|
14 |
AIExecMode::AIExecMode() |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff
changeset
|
15 |
{ |
9473
dcbcd1c4496d
(svn r9318) [NoAI] -Add: added new param in ModeCallback: costs
truelight
parents:
9450
diff
changeset
|
16 |
this->last_mode = this->GetDoCommandMode(); |
dcbcd1c4496d
(svn r9318) [NoAI] -Add: added new param in ModeCallback: costs
truelight
parents:
9450
diff
changeset
|
17 |
this->last_instance = this->GetDoCommandModeInstance(); |
dcbcd1c4496d
(svn r9318) [NoAI] -Add: added new param in ModeCallback: costs
truelight
parents:
9450
diff
changeset
|
18 |
this->SetDoCommandMode(&AIExecMode::ModeProc, this); |
9450
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff
changeset
|
19 |
} |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff
changeset
|
20 |
|
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff
changeset
|
21 |
AIExecMode::~AIExecMode() |
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff
changeset
|
22 |
{ |
9473
dcbcd1c4496d
(svn r9318) [NoAI] -Add: added new param in ModeCallback: costs
truelight
parents:
9450
diff
changeset
|
23 |
this->SetDoCommandMode(this->last_mode, this->last_instance); |
9450
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff
changeset
|
24 |
} |