src/ai/api/ai_execmode.cpp
branchnoai
changeset 9450 d675836e865c
child 9473 dcbcd1c4496d
equal deleted inserted replaced
9449:8b688e6517d0 9450:d675836e865c
       
     1 /* $Id$ */
       
     2 
       
     3 /** @file ai_execmode.cpp class to switch the AI to Execute mode */
       
     4 
       
     5 #include "ai_execmode.hpp"
       
     6 
       
     7 bool AIExecMode::ModeProc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc)
       
     8 {
       
     9 	/* In execution mode we only return 'true', telling the DoCommand it
       
    10 	 *  should continue with the real execution of the command. */
       
    11 	return true;
       
    12 }
       
    13 
       
    14 AIExecMode::AIExecMode()
       
    15 {
       
    16 	this->last_mode = this->GetDoCommandMode();
       
    17 	this->SetDoCommandMode(&AIExecMode::ModeProc);
       
    18 }
       
    19 
       
    20 AIExecMode::~AIExecMode()
       
    21 {
       
    22 	this->SetDoCommandMode(this->last_mode);
       
    23 }