Create a gist now

Instantly share code, notes, and snippets.

delegate void KeywordAction(PhraseRecognizedEventArgs args);
Dictionary<string, KeywordAction> keywordCollection;
void Start()
{
keywordCollection = new Dictionary<string, KeywordAction>();
// Add keyword to start manipulation.
// keywordCollection.Add("Move Astronaut", MoveAstronautCommand);
keywordCollection.Add("Move", MoveAstronautCommand);
/* TODO: DEVELOPER CODING EXERCISE 5.a */
// 5.a: Add keyword Expand Model to call the ExpandModelCommand function.
keywordCollection.Add("Expand Model", ExpandModelCommand);
// 5.a: Add keyword Reset Model to call the ResetModelCommand function.
keywordCollection.Add("Reset Model", ResetModelCommand);
// Initialize KeywordRecognizer with the previously added keywords.
keywordRecognizer = new KeywordRecognizer(keywordCollection.Keys.ToArray());
keywordRecognizer.OnPhraseRecognized += KeywordRecognizer_OnPhraseRecognized;
keywordRecognizer.Start();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment