コード例 #1
0
        /// <summary>
        /// Check an individual node
        /// </summary>
        /// <param name="context"></param>
        /// <param name="checkCell"></param>
        /// <returns></returns>
        private bool CheckCorner(StaticAnalysis context, VectorInt checkCell)
        {
            // Check to see if this if a floor. As we do not have an explicit floor map use the wall map implicitly
            if (context.WallMap[checkCell]) return false;

            // Check TopRight
            if (context.WallMap[checkCell.Add(0, -1)] && context.WallMap[checkCell.Add(1, 0)]) return true;

            // Check TopLeft
            if (context.WallMap[checkCell.Add(0, -1)] && context.WallMap[checkCell.Add(-1, 0)]) return true;

            // Check BottomRight
            if (context.WallMap[checkCell.Add(0, 1)] && context.WallMap[checkCell.Add(1, 0)]) return true;

            // Check BottomLeft
            if (context.WallMap[checkCell.Add(-1, 0)] && context.WallMap[checkCell.Add(0, 1)]) return true;

            return false;
        }
コード例 #2
0
 public RectangleInt(VectorInt aTopLeft, SizeInt aSize)
 {
     TopLeft = aTopLeft;
     BottomRight = aTopLeft.Add(aSize);
 }