diff options
author | rubidium <rubidium@openttd.org> | 2007-08-30 20:40:33 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-08-30 20:40:33 +0000 |
commit | 8a6cc3aa104b5f8631dcb74343dcd68ffa3308ec (patch) | |
tree | 1e96eadb775a124c36850f50c357f93af14e4be2 /src/station.h | |
parent | 9833639b00ff84b671a3943e350ed195935e31ad (diff) | |
download | openttd-8a6cc3aa104b5f8631dcb74343dcd68ffa3308ec.tar.xz |
(svn r11009) -Codechange: unvirtualise IsValid as that isn't needed with templates. This gives up to 10% performance increase in games with lots of vehicles.
Diffstat (limited to 'src/station.h')
-rw-r--r-- | src/station.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/station.h b/src/station.h index 5f48abec2..71abc5750 100644 --- a/src/station.h +++ b/src/station.h @@ -65,7 +65,11 @@ struct RoadStop : PoolItem<RoadStop, RoadStopID, &_RoadStop_pool> { RoadStop(TileIndex tile = 0); virtual ~RoadStop(); - bool IsValid() const; + /** + * Determines whether a road stop exists + * @return true if and only is the road stop exists + */ + inline bool IsValid() const { return this->xy != 0; } /* For accessing status */ bool HasFreeBay() const; @@ -175,7 +179,12 @@ public: uint GetPlatformLength(TileIndex tile, DiagDirection dir) const; uint GetPlatformLength(TileIndex tile) const; bool IsBuoy() const; - bool IsValid() const; + + /** + * Determines whether a station exists + * @return true if and only is the station exists + */ + inline bool IsValid() const { return this->xy != 0; } }; enum StationType { |