diff -r acb078280f60 -r b3b8bb6c0a48 src/fsmport.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/fsmport.h Tue Aug 21 09:02:06 2007 +0000 @@ -0,0 +1,58 @@ +/* $Id$ */ + +/** @file fsmport.h Various (base) declarations for FSM built ports */ + +#ifndef FSMPORT_H +#define FSMPORT_H + +#include "direction.h" +#include "fsmblockmap.h" + +struct FSMPortMovingData { + int16 x; + int16 y; + int16 z; + uint16 flag; + Direction direction; + byte state; + byte block; //block number for this specific location +}; + +struct FSMState { + FSMState *next; ///< Possible extra movement choices from this position + FSMblockmap reserveblock; ///< The blocks to reserve at this state + FSMblockmap releaseblock; ///< The blocks to release at this state + byte position; ///< The position that a vehicle is at + byte next_position; ///< Next position from this position + byte heading; ///< Heading (current orders), guiding a vehicle to its target on a port + byte special; ///< Used as extra data for special orders 7B, 7C, 7D, 7E +}; + + +struct FSMPortClass { +public: + FSMPortClass() : moving_data(NULL), layout(NULL), nof_elements(0), depots(NULL), + nof_depots(0), size_x(0), size_y(0), delta_z(0), catchment(0) {} + + ~FSMPortClass(); + + const FSMPortMovingData *MovingData(byte position) const + { + assert(position < this->nof_elements); + return &this->moving_data[position]; + } + + FSMPortMovingData *moving_data; + FSMState *layout; + byte nof_elements; // number of positions the airport consists of + + TileIndexDiffC *depots; // gives the position of the depots on the airports + byte nof_depots; // number of depots this airport has + + byte size_x; + byte size_y; + byte delta_z; // Z adjustment for helicopter pads + byte catchment; +}; + +#endif /* FSMPORT_H */