private void OnExpandedToNewSquares(Direction dir) { switch (dir) { case Direction.Up: case Direction.Left: m_UL = m_UL.Next(dir); break; case Direction.Down: case Direction.Right: m_LR = m_LR.Next(dir); break; } }
private GridSquare SquareOnRectOuter(GridSquare startSquare, Rect rect, Direction dir) { var next = startSquare.Next(dir); while (next.Rect.IsOverlappingWith(rect, dir)) { startSquare = next; next = next.Next(dir); } return(startSquare); }