| author | truebrain |
| Sat, 23 Feb 2008 14:49:31 +0000 | |
| branch | noai |
| changeset 9743 | 4c44aa6a8f43 |
| parent 9629 | 66dde6412125 |
| child 9833 | 89a64246458f |
| 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 |
|
|
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff
changeset
|
3 |
/** @file ai_testmode.cpp class to switch the AI to Testing mode */ |
|
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_testmode.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 AITestMode::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 test mode we only return 'false', 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 stop after testing the command and return with that result. */ |
|
d675836e865c
(svn r9278) [NoAI] -Add: added AISettings which adds the function to control the Delay-value on DoCommands
truelight
parents:
diff
changeset
|
11 |
return false; |
|
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 |
AITestMode::AITestMode() |
|
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(&AITestMode::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 |
AITestMode::~AITestMode() |
|
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 |
} |