///<summary> /// Finds the longest Move which matches the given input, if any. /// </summary> public Move DetectMove(InputManager input) { //perform a linear search for a move which matches the input. //this relies on the move array being in order of decreasing sequence length foreach (Move move in movesList) { if (input.SequenceMatchesMove(move)) { return move; } } return null; }