Exemple #1
0
 public void Dispatch(VyroGesture gesture)
 {
     foreach (GestureTrigger trigger in _Triggers.Values.Where(t => t is GestureTrigger))
         if (trigger.Check(gesture))
             trigger.Activate();
 }
Exemple #2
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);
 }
Exemple #3
0
 public bool Check(VyroGesture gesture)
 {
     return (CheckHand(gesture.HandIds) && CheckGesture(gesture));
 }
Exemple #4
0
 protected abstract bool CheckGesture(VyroGesture gesture);
Exemple #5
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
                   );
        }