예제 #1
0
파일: depot_map.cs 프로젝트: lmxdk/Nopenttd
/**
 * Check if a tile is a depot and it is a depot of the given type.
 */
        public static bool IsDepotTypeTile(this TileIndex tile, TransportType type)
        {
            switch (type)
            {
            default: throw new NotReachedException();

            case TransportType.TRANSPORT_RAIL: return(tile.IsRailDepotTile());

            case TransportType.TRANSPORT_ROAD: return(tile.IsRoadDepotTile());

            case TransportType.TRANSPORT_WATER: return(tile.IsShipDepotTile());

            case TransportType.TRANSPORT_AIR: return(tile.IsHangarTile());
            }
        }
예제 #2
0
파일: depot_map.cs 프로젝트: lmxdk/Nopenttd
/**
 * Get the index of which depot is attached to the tile.
 * @param t the tile
 * @pre IsRailDepotTile(t) || IsRoadDepotTile(t) || IsShipDepotTile(t)
 * @return DepotID
 */
        public static DepotID GetDepotIndex(TileIndex t)
        {
            /* Hangars don't have a Depot class, thus store no DepotID. */
            Debug.Assert(t.IsRailDepotTile() || t.IsRoadDepotTile() || t.IsShipDepotTile());
            return(Map._m[t].m2);
        }
예제 #3
0
파일: depot_map.cs 프로젝트: lmxdk/Nopenttd
/**
 * Is the given tile a tile with a depot on it?
 * @param tile the tile to check
 * @return true if and only if there is a depot on the tile.
 */
        public static bool IsDepotTile(this TileIndex tile)
        {
            return(tile.IsRailDepotTile() || tile.IsRoadDepotTile() || tile.IsShipDepotTile() || tile.IsHangarTile());
        }