Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
        }