コード例 #1
0
        /// <summary>
        /// Находит идеальный жест с помощью ключа
        /// </summary>
        /// <returns> Индекс жеста из списка идеальных жестов</returns>
        public int WhatIsItWithKey()
        {
            var    keyUsersGesture = KeyGestureConstruction.GetKeyForGesture(points);
            double minDist         = Int32.MaxValue;
            int    index           = -1;

            for (int i = 0; i < PGC.IdealGestures.Count; i++)
            {
                var temp = Distance.LevenshteinDistance(PGC.IdealGestures[i].Key, keyUsersGesture);
                if (minDist > temp)
                {
                    index   = i;
                    minDist = temp;
                }
            }
            return(index);
        }
コード例 #2
0
 public IdealGesture(string name, List <Point> points)
 {
     Name   = name;
     Points = points;
     Key    = KeyGestureConstruction.GetKeyForGesture(points);
 }