(svn r16934) -Codechange: introduce a simple helper function to check whether a station is pending deletion or not

This commit is contained in:
rubidium
2009-07-24 07:38:10 +00:00
parent fb36ebd9dd
commit 7b07e93b89
6 changed files with 19 additions and 8 deletions

View File

@@ -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)