Пример #1
0
 /// <summary>
 /// Finds the longest Move which matches the given input, if any.
 /// </summary>
 public Move DetectMove(GamePlayInput input)
 {
     // Perform a linear search for a move which matches the input. This relies
     // on the moves array being in order of decreasing sequence length.
     foreach (Move move in moves)
     {
         if (input.Matches(move))
         {
             return move;
         }
     }
     return null;
 }