Exemple #1
0
 /// <summary>
 /// 添加定义的手势
 /// </summary>
 /// <param name="present">手势代表的字符</param>
 /// <param name="gesture">手势数据,8个方向,从右开始为0,顺时针指定</param>
 /// <param name="match">匹配的回调,可以为null</param>
 public void AddGesture(string present, string gesture, MatchHandler.matchHandler match)
 {
     int[]  g            = new int[gesture.Length];
     char[] gestureArray = gesture.ToCharArray();
     for (int i = 0; i < gesture.Length; i++)
     {
         g[i] = gestureArray[i].ToString().Equals(".") ? -1 : int.Parse(gestureArray[i].ToString());
     }
     gestures.Add(new GestureProperties(present, g, match));
 }
Exemple #2
0
 public GestureProperties(string present, int[] moves, MatchHandler.matchHandler handler)
 {
     this.present = present;
     this.moves   = moves;
     this.handler = handler;
 }