CCT.NUI.HandTracking.ShapeHandDataFactory.CreateHandCollection C# (CSharp) Method

CreateHandCollection() private method

private CreateHandCollection ( ShapeCollection shapes ) : HandCollection
shapes CCT.NUI.Core.Shape.ShapeCollection
return HandCollection
        private HandCollection CreateHandCollection(ShapeCollection shapes)
        {
            var map = new DistanceMap<HandData, Shape>(currentValue.Hands);
            map.Map(shapes.Shapes);

            var handData = new List<HandData>();
            foreach (var tupple in map.MappedItems)
            {
                handData.Add(this.Create(tupple.Item1, tupple.Item2));
            }
            foreach (var shape in map.UnmappedItems)
            {
                handData.Add(this.Create(shape));
            }
            foreach (var discontinuedHandData in map.DiscontinuedItems)
            {
                this.ReturnIdToPool(discontinuedHandData.Id);
            }

            return new HandCollection(handData);
        }