summaryrefslogtreecommitdiff
path: root/src/station.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-06-23 21:44:48 +0000
committersmatz <smatz@openttd.org>2009-06-23 21:44:48 +0000
commit0045096403ed050cf972aef6d146535bbb88f713 (patch)
treec2d5afb33a93771903898ca7192ded5d3d40c731 /src/station.cpp
parent8bb88e5f7236738f2101b96a3d23a4252464a615 (diff)
downloadopenttd-0045096403ed050cf972aef6d146535bbb88f713.tar.xz
(svn r16640) -Codechange: move roadstop stuff to separate files
Diffstat (limited to 'src/station.cpp')
-rw-r--r--src/station.cpp52
1 files changed, 1 insertions, 51 deletions
diff --git a/src/station.cpp b/src/station.cpp
index d55618751..8ee0c17e4 100644
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -22,13 +22,12 @@
#include "settings_type.h"
#include "subsidy_func.h"
#include "core/pool_func.hpp"
+#include "roadstop_base.h"
#include "table/strings.h"
StationPool _station_pool("Station");
INSTANTIATE_POOL_METHODS(Station)
-RoadStopPool _roadstop_pool("RoadStop");
-INSTANTIATE_POOL_METHODS(RoadStop)
Station::Station(TileIndex tile) :
xy(tile),
@@ -437,56 +436,7 @@ StationRect& StationRect::operator = (Rect src)
}
-/************************************************************************/
-/* RoadStop implementation */
-/************************************************************************/
-
-/** Initializes a RoadStop */
-RoadStop::RoadStop(TileIndex tile) :
- xy(tile),
- status(3) // stop is free
-{
-}
-
-/** De-Initializes a RoadStops. This includes clearing all slots that vehicles might
- * have and unlinks it from the linked list of road stops at the given station
- */
-RoadStop::~RoadStop()
-{
- if (CleaningPool()) return;
-
- /* Clear the slot assignment of all vehicles heading for this road stop */
- if (num_vehicles != 0) {
- RoadVehicle *rv;
- FOR_ALL_ROADVEHICLES(rv) {
- if (rv->slot == this) ClearSlot(rv);
- }
- }
- assert(num_vehicles == 0);
-}
-
-/**
- * Get the next road stop accessible by this vehicle.
- * @param v the vehicle to get the next road stop for.
- * @return the next road stop accessible.
- */
-RoadStop *RoadStop::GetNextRoadStop(const RoadVehicle *v) const
-{
- for (RoadStop *rs = this->next; rs != NULL; rs = rs->next) {
- /* The vehicle cannot go to this roadstop (different roadtype) */
- if ((GetRoadTypes(rs->xy) & v->compatible_roadtypes) == ROADTYPES_NONE) continue;
- /* The vehicle is articulated and can therefor not go the a standard road stop */
- if (IsStandardRoadStopTile(rs->xy) && RoadVehHasArticPart(v)) continue;
-
- /* The vehicle can actually go to this road stop. So, return it! */
- return rs;
- }
-
- return NULL;
-}
-
void InitializeStations()
{
_station_pool.CleanPool();
- _roadstop_pool.CleanPool();
}