Esempio n. 1
0
        protected override bool CheckGesture(VyroGesture gesture)
        {
            var circle = gesture as VyroGestureCircle;

            if (circle == null)
            {
                return(false);
            }
            return(circle.IsClockwise == IsClockwise && circle.Radius >= MinRadius && circle.Radius <= MaxRadius);
        }
Esempio n. 2
0
 public void Dispatch(VyroGesture gesture)
 {
     foreach (GestureTrigger trigger in _Triggers.Values.Where(t => t is GestureTrigger))
     {
         if (trigger.Check(gesture))
         {
             trigger.Activate();
         }
     }
 }
Esempio n. 3
0
        protected override bool CheckGesture(VyroGesture gesture)
        {
            var swipe = gesture as VyroGestureSwipe;

            if (swipe == null)
            {
                return(false);
            }

            var angle = swipe.Direction.RollDegrees();

            if (angle < 0)
            {
                angle += 360;
            }

            return(
                swipe.Velocity >= MinVelocity && swipe.Velocity <= MaxVelocity
                &&
                swipe.Distance >= MinDistance && swipe.Distance <= MaxDistance
                &&
                angle >= MinAngle && angle <= MaxAngle
                );
        }
Esempio n. 4
0
 public bool Check(VyroGesture gesture)
 {
     return(CheckHand(gesture.HandIds) && CheckGesture(gesture));
 }
Esempio n. 5
0
 protected abstract bool CheckGesture(VyroGesture gesture);