forked from craftycodie/Sunrise-BlfTool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
59 lines (52 loc) · 1.78 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using SunriseBlfTool.TitleConverters;
using System;
namespace SunriseBlfTool
{
class Program
{
static void Main(string[] args)
{
if (args.Length == 3 & args[0] == "reach_variants")
{
ReachVariantConverter.ConvertVariantFolder(args[1], args[2]);
}
else if (args.Length == 4)
{
if (args[0].Equals("json"))
{
ConvertBlfToJson(args[1], args[2], args[3]);
}
if (args[0].Equals("blf"))
{
ConvertJsonToBlf(args[1], args[2], args[3]);
}
else
{
Console.WriteLine("Invalid command.");
}
}
else
{
Console.WriteLine("Not enough arguments provided.");
}
}
public static void ConvertJsonToBlf(string jsonFolder, string blfFolder, string version)
{
var titleConverter = TitleConverterVersionMap.singleton.GetConverter(version);
if (titleConverter == null)
{
throw new NotImplementedException("No converter for version " + version);
}
titleConverter.ConvertJsonToBlf(jsonFolder, blfFolder);
}
public static void ConvertBlfToJson(string titleStorageFolder, string jsonFolder, string version)
{
var titleConverter = TitleConverterVersionMap.singleton.GetConverter(version);
if (titleConverter == null)
{
throw new NotImplementedException("No converter for version " + version);
}
titleConverter.ConvertBlfToJson(titleStorageFolder, jsonFolder);
}
}
}