diff options
author | rubidium <rubidium@openttd.org> | 2007-02-13 00:25:42 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-02-13 00:25:42 +0000 |
commit | 3f74dbe5c075610637ec10a0b077a0a8710fd610 (patch) | |
tree | 1659c231e1a1a50b63b787697ddedc12a7d2895f /src/station.h | |
parent | 654aca2b32f47d9a6495bdf23fcda0f14e009083 (diff) | |
download | openttd-3f74dbe5c075610637ec10a0b077a0a8710fd610.tar.xz |
(svn r8694) -Codechange: make RoadStop's status accessible via accessor functions.
Diffstat (limited to 'src/station.h')
-rw-r--r-- | src/station.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/station.h b/src/station.h index eb345f0d0..d9f6d0c32 100644 --- a/src/station.h +++ b/src/station.h @@ -44,10 +44,11 @@ struct RoadStop { static const int cDebugCtorLevel = 3; ///< Debug level on which Contructor / Destructor messages are printed static const uint LIMIT = 16; ///< The maximum amount of roadstops that are allowed at a single station + static const uint MAX_BAY_COUNT = 2; ///< The maximum number of loading bays TileIndex xy; ///< Position on the map RoadStopID index; ///< Global (i.e. pool-wide) index - byte status; ///< Current status of the Stop. Like which spot is taken. TODO - enumify this + byte status; ///< Current status of the Stop. Like which spot is taken. Access using *Bay and *Busy functions. byte num_vehicles; ///< Number of vehicles currently slotted to this stop struct RoadStop *next; ///< Next stop of the given type at this station @@ -62,6 +63,13 @@ struct RoadStop { void operator delete(void *rs, int index); bool IsValid() const; + + /* For accessing status */ + bool HasFreeBay() const; + uint AllocateBay(); + void FreeBay(uint nr); + bool IsEntranceBusy() const; + void SetEntranceBusy(bool busy); protected: static RoadStop *AllocateRaw(void); }; |