1
/* $Id: ai_execmode.cpp 15060 2009-01-13 15:44:36Z smatz $ */
3
/** @file ai_execmode.cpp Implementation of AIExecMode. */
5
#include "ai_execmode.hpp"
6
#include "../../command_type.h"
8
bool AIExecMode::ModeProc(TileIndex tile, uint32 p1, uint32 p2, uint procc, CommandCost costs)
10
/* In execution mode we only return 'true', telling the DoCommand it
11
* should continue with the real execution of the command. */
15
AIExecMode::AIExecMode()
17
this->last_mode = this->GetDoCommandMode();
18
this->last_instance = this->GetDoCommandModeInstance();
19
this->SetDoCommandMode(&AIExecMode::ModeProc, this);
22
AIExecMode::~AIExecMode()
24
assert(this->GetDoCommandModeInstance() == this);
25
this->SetDoCommandMode(this->last_mode, this->last_instance);