00001 /* $Id: waypoint_base.h 17248 2009-08-21 20:21:05Z rubidium $ */ 00002 00003 /* 00004 * This file is part of OpenTTD. 00005 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. 00006 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00007 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>. 00008 */ 00009 00012 #ifndef WAYPOINT_H 00013 #define WAYPOINT_H 00014 00015 #include "base_station_base.h" 00016 00017 struct Waypoint : SpecializedStation<Waypoint, true> { 00018 uint16 town_cn; 00019 00020 Waypoint(TileIndex tile = INVALID_TILE) : SpecializedStation<Waypoint, true>(tile) { } 00021 ~Waypoint(); 00022 00023 void UpdateVirtCoord(); 00024 00025 /* virtual */ FORCEINLINE bool TileBelongsToRailStation(TileIndex tile) const 00026 { 00027 return IsRailWaypointTile(tile) && GetStationIndex(tile) == this->index; 00028 } 00029 00030 /* virtual */ uint32 GetNewGRFVariable(const struct ResolverObject *object, byte variable, byte parameter, bool *available) const; 00031 00032 /* virtual */ void GetTileArea(TileArea *ta, StationType type) const; 00033 00034 /* virtual */ uint GetPlatformLength(TileIndex tile, DiagDirection dir) const 00035 { 00036 return 1; 00037 } 00038 00039 /* virtual */ uint GetPlatformLength(TileIndex tile) const 00040 { 00041 return 1; 00042 } 00043 }; 00044 00045 #define FOR_ALL_WAYPOINTS(var) FOR_ALL_BASE_STATIONS_OF_TYPE(Waypoint, var) 00046 00047 #endif /* WAYPOINT_H */