public Personality(AerTalk voiceSynth, AerDB data) { _Data = data; _Talk = voiceSynth; _ReqQuery = Settings.Load("RequireAerQuery", "1").Equals("1"); _Talk.SayInitializing(); _EventRegistry = new Dictionary <string, AerInputHandler>(); _Keyboard = new AerKeyboard(); _GalnetRSS = new AerRSS("http://www.elitedangerous.com/en/news/galnet/rss"); _JokeRSS = new AerRSS("http://www.jokes2go.com/jspq.xml"); _Wikipedia = new AerWiki(); _StopListeningTime = 30; //30 seconds _RegisterDefaultHandlers(); }
static void Main(string[] args) { Console.WriteLine("Welcome to the A.E.R. Interface Console"); AerDB data = new AerDB(@"json\"); AerTalk talk = new AerTalk(); Personality person = new Personality(talk, data); _AerHandler = new AerHandler(data, person); //I know this is bad, but there's no good way to get the delegate surfaced out of AerInput in to AerTalk yet. // This could be solved with a service registry, but I haven't thought that through yet _AerInput = new AerInput(@"Grammars\", person.GrammarLoaded_Handler); HandleInput(); }
public Personality(AerTalk voiceSynth, AerDB data) { _Data = data; _Talk = voiceSynth; _ReqQuery = Settings.Load("RequireAerQuery", "1").Equals("1"); _Talk.SayInitializing(); _EventRegistry = new Dictionary<string, AerInputHandler>(); _Keyboard = new AerKeyboard(); _GalnetRSS = new AerRSS("http://www.elitedangerous.com/en/news/galnet/rss"); _JokeRSS = new AerRSS("http://www.jokes2go.com/jspq.xml"); _Wikipedia = new AerWiki(); _StopListeningTime = 30; //30 seconds _RegisterDefaultHandlers(); }
public static void ExecuteThread() { AerTalk talk = new AerTalk(); AerDB data = new AerDB(AppDomain.CurrentDomain.BaseDirectory + @"\Apps\AER\json\"); Personality person = new Personality(talk, data); _AerHandler = new AerHandler(data, person); _AerInput = new AerInput(AppDomain.CurrentDomain.BaseDirectory + @"\Apps\AER\Grammars\", person.GrammarLoaded_Handler); while(_RunWorker) { if (_AerInput.NewInput) { _AerInput.NewInput = false; _AerHandler.InputHandler(_AerInput.LastResult); } } }
public AerHandler(AerTalk voiceSynth, string pathToJsonFiles = @"json\") { string systemsJson = pathToJsonFiles + @"systems.json"; string commoditiesJson = pathToJsonFiles + @"commodities.json"; string stationsJson = pathToJsonFiles + @"stations.json"; _Squelched = false; _Talk = voiceSynth; _Talk.SayInitializing(); _GalnetEntry = 0; _JokeEntry = 0; _Keyboard = new AerKeyboard(); _GalnetRSS = new AerRSS("http://www.elitedangerous.com/en/news/galnet/rss"); _JokeRSS = new AerRSS("http://www.jokes2go.com/jspq.xml"); _Wikipedia = new AerWiki(); _Eddb = new AerDB(systemsJson, stationsJson, commoditiesJson); _EventRegistry = new Dictionary <string, AerInputHandler>(); RegisterDefaultHandlers(); }
public void ExecuteThread() { AerDB data = new AerDB(@"json\"); AerTalk talk = new AerTalk(); Personality person = new Personality(talk, data); AerHandler handler = new AerHandler(data, person); //I know this is bad, but there's no good way to get the delegate surfaced out of AerInput in to AerTalk yet. // This could be solved with a service registry, but I haven't thought that through yet AerInput input = new AerInput(@"Grammars\", person.GrammarLoaded_Handler); while (_RunWorker) { if (input.NewInput) { input.NewInput = false; handler.InputHandler(input.LastResult); } Thread.Sleep(10); //Keep CPU usage down until we handle responses async } }