Beispiel #1
0
        /**
         * Finds the end of a bridge in the specified direction starting at a middle tile
         * @param tile the bridge tile to find the bridge ramp for
         * @param dir  the direction to search in
         */
        public static TileIndex GetBridgeEnd(TileIndex tile, DiagDirection dir)
        {
            TileIndexDiff delta = Map.TileOffsByDiagDir(dir);

            dir = dir.ReverseDiagDir();
            do
            {
                tile += (uint)delta.Difference;
            } while (!IsBridgeTile(tile) || GetTunnelBridgeDirection(tile) != dir);

            return(tile);
        }