Esempio n. 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to the Navigation Matrix Console by CMDR Antrys\nBased on A.E.R. By SingularTier");
            NMDB data = new NMDB(@"json\");
            NMTalk talk = new NMTalk();
            Personality person = new Personality(talk, data);
            //Settings.ReloadSettings();
            _AerHandler = new NMHandler(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 NMInput(@"Grammars\", person.GrammarLoaded_Handler);

            HandleInput();
        }
Esempio n. 2
0
        public Personality(NMTalk voiceSynth, NMDB data)
        {
            _Data = data;
            _Talk = voiceSynth;
            //_ReqQuery = Settings.Load("RequireAerQuery", "1").Equals("1");
            _Talk.SayInitializing();
            _EventRegistry = new Dictionary<string, AerInputHandler>();
            _Keyboard = new NMKeyboard();
            //_GalnetRSS = new NMRSS("http://www.elitedangerous.com/en/news/galnet/rss");
            //_GalnetRSS = new NMRSS("http://community.elitedangerous.com/galnet");
            _JokeRSS = new NMRSS("http://www.jokes2go.com/jspq.xml");
            _Wikipedia = new NMWiki();
            //_StopListeningTime = 30; //30 seconds

            _RegisterDefaultHandlers();
        }
Esempio n. 3
0
 public static void ExecuteThread()
 {
     NMTalk talk = new NMTalk(AppDomain.CurrentDomain.BaseDirectory + @"\Apps\Aer\Sounds\");
     NMDB data = new NMDB(AppDomain.CurrentDomain.BaseDirectory + @"\Apps\AER\json\");
     Personality person = new Personality(talk, data);
     _AerHandler = new NMHandler(data, person);
     _AerInput = new NMInput(AppDomain.CurrentDomain.BaseDirectory + @"\Apps\AER\Grammars\", person.GrammarLoaded_Handler);
     //Settings pluginp = new Settings(AppDomain.CurrentDomain.BaseDirectory + @"\Apps\AER\");
     while(_RunWorker)
     {
         if (_AerInput.NewInput)
         {
             _AerInput.NewInput = false;
             _AerHandler.InputHandler(_AerInput.LastResult);
         }
     }
 }
        public void ExecuteThread()
        {
            NMDB data = new NMDB(@"json\");
            NMTalk talk = new NMTalk();

            Personality person = new Personality(talk, data);
            NMHandler handler = new NMHandler(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
            NMInput input = new NMInput(@"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
            }
        }
Esempio n. 5
0
 public NMHandler(NMDB data, Personality personality)
 {
     _Data = data;
     _Personality = personality;
 }