truelight@9450: /* $Id$ */ truelight@9450: truelight@9450: /** @file ai_testmode.cpp class to switch the AI to Testing mode */ truelight@9450: truelight@9450: #include "ai_testmode.hpp" truelight@9450: truelight@9486: bool AITestMode::ModeProc(TileIndex tile, uint32 p1, uint32 p2, uint procc, int32 costs) truelight@9450: { truelight@9450: /* In test mode we only return 'false', telling the DoCommand it truelight@9450: * should stop after testing the command and return with that result. */ truelight@9450: return false; truelight@9450: } truelight@9450: truelight@9450: AITestMode::AITestMode() truelight@9450: { truelight@9473: this->last_mode = this->GetDoCommandMode(); truelight@9473: this->last_instance = this->GetDoCommandModeInstance(); truelight@9473: this->SetDoCommandMode(&AITestMode::ModeProc, this); truelight@9450: } truelight@9450: truelight@9450: AITestMode::~AITestMode() truelight@9450: { truelight@9473: this->SetDoCommandMode(this->last_mode, this->last_instance); truelight@9450: }