protected override bool CanSelectSingleObject(SnagCardGameCardInformation thisObject)
        {
            if (thisObject.Equals(HandList.Last()))
            {
                return(true);
            }
            if (HandList.Count() == 1)
            {
                return(false); //i think.
            }
            int index = HandList.Count - 2;

            return(thisObject.Equals(HandList[index]));
        }
        public void CountNumber(Leap.Frame frame)
        {
            //create handlist
            HandList hands = frame.Hands;

            //get the front most hand
            Hand frontmost = hands.Frontmost;

            //pass the front most hand type to label
            if (frontmost.IsLeft)
            {
                frontmostType.Content = "Left";
            }
            else
            {
                frontmostType.Content = "Right";
            }

            //pass the hand's basic information to its labels
            foreach (Hand hand in hands)
            {
                int         handCount  = hands.Count();
                Leap.Vector direction  = hand.Direction;
                Leap.Vector PalmNormal = hand.PalmNormal;
                Leap.Vector center     = hand.PalmPosition;
                Leap.Vector moveRate   = hand.PalmVelocity;

                HandCount.Content    = handCount;
                Direction.Content    = direction;
                PalmPosition.Content = center;
                normalVector.Content = PalmNormal;

                //pass finger number in front hand to label( it is always five, with the new Leap Motion Hand model)
                FingerList fingers = hand.Fingers;
                FingerCount.Content = fingers.Count();
            }
        }
示例#3
0
 public int HowManyCardsSelected() => HandList.Count(items => items.IsSelected);