-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
32 lines (24 loc) · 817 Bytes
/
Copy pathProgram.cs
File metadata and controls
32 lines (24 loc) · 817 Bytes
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
using PixelMCQuestsGeneration.Serialization;
using PixelMCQuestsGeneration.Console;
Console.WriteLine(args[0]);
if (args.Length == 0 || !File.Exists(args[0]))
{
Console.Error.WriteLine("Please specify file path to quests json.");
System.Environment.Exit(1);
}
string fileContents = "";
using (StreamReader reader = new StreamReader(args[0])) {
fileContents = reader.ReadToEnd();
}
PixelmonQuest pixelmonQuest = PixelmonQuest.FromJson(fileContents);
List<IQuestWriter> Writers = new List<IQuestWriter>
{
new StringsWriter(pixelmonQuest),
new StageWriter(pixelmonQuest),
};
Writers.ToList().ForEach(w => w.GiveConsole());
Console.WriteLine();
Console.WriteLine(pixelmonQuest.ToJson());
using (StreamWriter writer = new StreamWriter(args[0])) {
writer.Write(pixelmonQuest.ToJson());
}