protected virtual void OnFingerOpened(Finger finger) { var handler = FingerOpened; if (handler != null) handler(finger, new EventArgs()); }
public Hand(Side side) { Thumb = new Finger(FingerKind.Thumb); Index = new Finger(FingerKind.Index); Middle = new Finger(FingerKind.Middle); Ring = new Finger(FingerKind.Ring); Pinky = new Finger(FingerKind.Pinky); Side = side; var fingers = GetAllFingers(); fingers.ForEach(f => f.Opened += (s, a) => OnFingerOpened(f)); fingers.ForEach(f => f.Closed += (s, a) => OnFingerClosed(f)); }
public Hand(Side side) { Thumb = new Finger(FingerKind.Thumb); Index = new Finger(FingerKind.Index); Middle = new Finger(FingerKind.Middle); Ring = new Finger(FingerKind.Ring); Pinky = new Finger(FingerKind.Pinky); Side = side; var fingers = GetAllFingers(); foreach (var finger in fingers) { var f = finger; finger.Opened += (s, a) => OnFingerOpened(f); finger.Closed += (s, a) => OnFingerClosed(f); } }