예제 #1
0
        /**
         * Get the tileoffset from this tile a ship should target to get to this dock.
         * @param t Tile to query
         * @pre TileMap.IsTileType(t, TileType.MP_STATION)
         * @pre IsBuoy(t) || IsOilRig(t) || IsDock(t)
         * @return The offset from this tile that should be used as destination for ships.
         */
        public static TileIndexDiffC GetDockOffset(this TileIndex t)
        {
            Debug.Assert(TileMap.IsTileType(t, TileType.MP_STATION));

            if (IsBuoy(t))
            {
                return(buoy_offset);
            }
            if (IsOilRig(t))
            {
                return(oilrig_offset);
            }

            Debug.Assert(IsDock(t));

            return(dock_offset[t.GetDockDirection()]);
        }