Ejemplo n.º 1
0
    private GameCell GetMoveInDirection(Vector2 currentPosition)
    {
        GameCell move = GetMove(currentPosition, direction);

        if (move != null && move.IsEmpty())
        {
            return(move);
        }
        // switch to oposite direction
        this.direction = GetOpositeDirection(direction);
        move           = GetMove(currentPosition, direction);
        if (move != null && move.IsEmpty())
        {
            return(move);
        }
        return(null);
    }