Пример #1
0
        public static void HandleResponses(List <DialogResponse> responses)
        {
            DialogWriter.WriteResponses(responses);

ReadResponse:
            int responseIndex = (int)char.GetNumericValue(Console.ReadKey().KeyChar) - 1;

            if (responseIndex != null && responseIndex >= 0 && responseIndex < responses.Count)
            {
                DialogWriter.WritePlayer(responses[responseIndex].ResponseText);
                if (responses[responseIndex].Consequence != null)
                {
                    responses[responseIndex].Consequence.Invoke();
                }
            }
            else
            {
                goto ReadResponse;
            }
        }
Пример #2
0
 public void Activate()
 {
     DialogWriter.Write(InitialVerb);
     ResponseHandler.HandleResponses(Responses);
 }