public MyTouch[] GetTwoFreeTouches() { MyTouch first = GetNewTouch(true); if (first != null) { MyTouch second = GetNewTouch(true); if (second != null) { first.SetAsOwned(); return(new MyTouch[2] { first, second }); } else { first.SetAsNotOwned(); return(null); } } else { return(null); } }
public MyTouch GetPressedMouse(bool setAsOwned) { if (MouseTouch != null && Touches.Count == 0 && !MouseTouch.HasOwner && MouseTouch.State == TouchState.JustPressed) { if (setAsOwned) { MouseTouch.SetAsOwned(); } return(MouseTouch); } return(null); }