Beispiel #1
0
    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;
        }
    }
Beispiel #2
0
    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);
    }