Example #1
0
        public override void Execute()
        {
            Debug.Assert(!string.IsNullOrWhiteSpace(OriginalPhrase));

            PrintedPhrase = OriginalPhrase.Trim(new char[] { ' ', '"', '\'' }).FirstCharToUpper();

            if (PrintedPhrase.Length == 0 || !Char.IsPunctuation(PrintedPhrase[PrintedPhrase.Length - 1]))
            {
                PrintedPhrase += ".";
            }

            ProcessedPhrase = PrintedPhrase.Trim(new char[] { '.', '?', '!' }).ToLower();

            ProcessEvents(EventType.BeforePrintSayText);

            if (GotoCleanup)
            {
                goto Cleanup;
            }

            gOut.Print("Okay, \"{0}\"", PrintedPhrase);

            ProcessEvents(EventType.AfterPrintSayText);

            if (GotoCleanup)
            {
                goto Cleanup;
            }

Cleanup:

            if (NextState == null)
            {
                NextState = Globals.CreateInstance <IMonsterStartState>();
            }
        }