Open tommasobertoni opened 3 years ago
A consumer may add additional properties to a command, like:
class MyCommand : Command { /* ... */ } var myCmd = new MyCommand { Id = "FindYellowBox", VoiceTriggers = new[] { "Find yellow box" }, Object = "box", Color = "yellow", };
At the moment in order to get this info back, the consumer needs to cast the command to its type:
covox.Recognized += (Command command, _) => { var myCmd = (MyCommand)command; // ... };
Proposal: Allow to create a typed instance of the engine, and accept/return only typed commands:
var covox = new CovoxEngine<MyCommand>(config); var cmds = new[] { new MyCommand() }; covox.RegisterCommands(cmds); covox.Recognized += (MyCommand command, _) => { /* ... */ };
A consumer may add additional properties to a command, like:
At the moment in order to get this info back, the consumer needs to cast the command to its type:
Proposal: Allow to create a typed instance of the engine, and accept/return only typed commands: