public void OnSomeoneSaidSomething(Speech pSpeech) { #if DEBUG if (!HasTing(pSpeech.speaker)) { throw new Exception("Can't find speaker with name '" + pSpeech.speaker + "'"); } #endif MimanTing speaker = GetTing(pSpeech.speaker) as MimanTing; speaker.Say(pSpeech.line, pSpeech.conversation); }
public object Connect(object[] args) { string name = ReturnValueConversions.SafeUnwrap <string>(args, 0); //Console.WriteLine(_caller + " connecting to " + name); MimanTing maybeTing = GetTingFromNameOrSourceCodeName(_tingRunner, name); // if (maybeTing is Character) { // _caller.Say("Can't connect to human " + name); // return new ReturnValue(-1); // } else if (maybeTing != null) { //_caller.PlaySound ("Modem"); return(_caller.AddConnectionToTing(maybeTing)); } else { if (_caller is Computer) { (_caller as Computer).API_Print("Can't find " + name + " to connect to"); } else { _caller.Say("Can't find " + name + " to connect to", ""); } return(-1f); } }
public float API_Connect(string name) { //Console.WriteLine(_caller + " connecting to " + name); MimanTing maybeTing = ConnectionAPI_Optimized.GetTingFromNameOrSourceCodeName(_tingRunner, name); // _tingRunner.GetTingUnsafe (name) as MimanTing; if (maybeTing != null) { return(_caller.AddConnectionToTing(maybeTing)); } else { string msg = "Can't find " + name + " to connect to"; if (_caller is Computer) { (_caller as Computer).API_Print(msg); } else { _caller.Say(msg, ""); } return(-1f); } }