-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
44 lines (42 loc) · 1.83 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.Collections;
using System.Collections.Generic;
using DialogueSystem;
namespace DialougeCreator
{
class Program
{
static void Main(string[] args)
{
DialogueManager manager = new DialogueManager();
DialogueNode starting = manager.startingDialouge;
Conversation convo = new Conversation(new string[] { "derek", "player" }, starting);
while (!convo.conversationEnded)
{
if (convo.CurrentDialouge.GetType() == (typeof(DialogueOptions)))
{
DialogueOptions newDialogue = (DialogueOptions)convo.CurrentDialouge;
Dialogue[] nodes = new Dialogue[100];
int i = 1;
foreach (KeyValuePair<string, Dialogue> option in newDialogue.Options)
{
Console.WriteLine(i + ": " + option.Key);
nodes[i] = option.Value;
i++;
}
Console.WriteLine("-----------------------------------------------");
int selection = int.Parse(Console.ReadLine());
Console.WriteLine("-----------------------------------------------");
Console.WriteLine(convo.GetCurrentSpeaker() + ": " + nodes[selection].phrase);
Console.WriteLine("-----------------------------------------------");
convo.ChooseOption(nodes[selection]);
}
else
{
Console.WriteLine(convo.GetCurrentSpeaker() + ": " + convo.ContinueConversaton());
Console.WriteLine("-----------------------------------------------");
}
}
}
}
}