EddiSpeechResponder.SpeechResponder.Say C# (CSharp) Method

Say() public method

public Say ( ScriptResolver resolver, string scriptName, Event theEvent = null, int priority = null, bool wait = null ) : void
resolver ScriptResolver
scriptName string
theEvent Event
priority int
wait bool
return void
        public void Say(ScriptResolver resolver, string scriptName, Event theEvent = null, int? priority = null, bool? wait = null)
        {
            Dictionary<string, Cottle.Value> dict = createVariables(theEvent);
            string script = resolver.resolve(scriptName, dict);
            if (script != null)
            {
                SpeechService.Instance.Say(EDDI.Instance.Ship, script, (wait == null ? true : (bool)wait), (priority == null ? resolver.priority(scriptName) : (int)priority));
            }
        }

Same methods

SpeechResponder::Say ( string scriptName, Event theEvent = null, int priority = null, bool wait = null ) : void

Usage Example

Beispiel #1
0
        private void testScript(object sender, RoutedEventArgs e)
        {
            Script          script    = ((KeyValuePair <string, Script>)((Button)e.Source).DataContext).Value;
            SpeechResponder responder = new SpeechResponder();

            responder.Start();
            // See if we have a sample
            Event  sampleEvent;
            object sample = Events.SampleByName(script.Name);

            if (sample == null)
            {
                sampleEvent = null;
            }
            else if (sample is string)
            {
                // It's as tring so a journal entry.  Parse it
                sampleEvent = JournalMonitor.ParseJournalEntry((string)sample);
            }
            else if (sample is Event)
            {
                // It's a direct event
                sampleEvent = (Event)sample;
            }
            else
            {
                Logging.Warn("Unknown sample type " + sample.GetType());
                sampleEvent = null;
            }

            ScriptResolver scriptResolver = new ScriptResolver(Personality.Scripts);

            responder.Say(scriptResolver, script.Name, sampleEvent);
        }
All Usage Examples Of EddiSpeechResponder.SpeechResponder::Say