From 803cf87885aa8b6382996940d6418250889b678c Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 24 Jul 2009 07:38:10 +0000 Subject: (svn r16934) -Codechange: introduce a simple helper function to check whether a station is pending deletion or not --- src/base_station_base.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/base_station_base.h') diff --git a/src/base_station_base.h b/src/base_station_base.h index a4cbb2fc0..407370260 100644 --- a/src/base_station_base.h +++ b/src/base_station_base.h @@ -94,6 +94,17 @@ struct BaseStation : StationPool::PoolItem<&_station_pool> { { return BaseStation::Get(GetStationIndex(tile)); } + + /** + * Check whether the base station currently is in use; in use means + * that it is not scheduled for deletion and that it still has some + * facilities left. + * @return true if still in use + */ + FORCEINLINE bool IsInUse() const + { + return (this->facilities & ~FACIL_WAYPOINT) != 0; + } }; #define FOR_ALL_BASE_STATIONS(var) FOR_ALL_ITEMS_FROM(BaseStation, station_index, var, 0) -- cgit v1.2.3-54-g00ecf