ai_order.cpp File Reference

Implementation of AIOrder. More...

#include "ai_order.hpp"
#include "ai_vehicle.hpp"
#include "../ai_instance.hpp"
#include "../../debug.h"
#include "../../vehicle_base.h"
#include "../../depot_base.h"
#include "../../station_map.h"
#include "../../waypoint.h"

Go to the source code of this file.

Functions

static OrderType GetOrderTypeByTile (TileIndex t)
 Gets the order type given a tile.
static void _DoCommandReturnChangeOrder (class AIInstance *instance)
 Callback handler as ChangeOrder possibly needs multiple DoCommand calls to be able to set all order flags correctly.


Detailed Description

Implementation of AIOrder.

Definition in file ai_order.cpp.


Function Documentation

static void _DoCommandReturnChangeOrder ( class AIInstance *  instance  )  [static]

Callback handler as ChangeOrder possibly needs multiple DoCommand calls to be able to set all order flags correctly.

As we need to wait till the command has completed before we know the next bits to change we need to call the function multiple times. Each time it'll reduce the difference between the wanted and the current order.

Parameters:
instance The AI we are doing the callback for.

Definition at line 189 of file ai_order.cpp.

References AIOrder::_ChangeOrder(), and AIObject::SetLastCommandRes().

Referenced by AIOrder::_ChangeOrder().

static OrderType GetOrderTypeByTile ( TileIndex  t  )  [static]

Gets the order type given a tile.

Parameters:
t the tile to get the order from
Returns:
the order type, or OT_END when there is no order

Definition at line 19 of file ai_order.cpp.

References GetRailTileType(), GetTileType(), IsValidTile(), MP_RAILWAY, MP_ROAD, MP_STATION, MP_WATER, RAIL_TILE_DEPOT, and RAIL_TILE_WAYPOINT.

Referenced by AIOrder::AreOrderFlagsValid(), and AIOrder::InsertOrder().


Generated on Mon Feb 16 23:12:13 2009 for openttd by  doxygen 1.5.6