Пример #1
0
        //TODO: Better name for this
        bool CheckHorizontalCorridor(Point a, Point b)
        {
            //TODO: Remove, this is for debugging:
            return(true);

            //check horizontal path
#pragma warning disable CS0162 // Unreachable code detected
            for (int x = Mathf.Min(a.X, b.X); x < Mathf.Max(a.X, b.X); x++)
            {
                if (map.Get(x, a.Y) != 0 && (a.X != x || b.X != x))
                {
                    return(false);
                }
            }

            //check vertical path
            for (int y = Mathf.Min(a.Y, b.Y); y < Mathf.Max(a.Y, b.Y); y++)
            {
                if (map.Get(b.X, y) != 0 && (a.Y != y || b.Y != y))
                {
                    return(false);
                }
            }

            return(true);

#pragma warning restore CS0162 // Unreachable code detected
        }