Fix setup

This commit is contained in:
glax 2024-01-18 00:21:51 +01:00
parent 41a433bf3f
commit 0f62e9e9c9

View File

@ -121,7 +121,7 @@ public static class Setup
"https://api.shocklink.net");
string apiKey = QueryString("OpenShock API-Key:","");
Console.WriteLine("Shocker IDs associated with this API:");
List<string> shockerIds = GetShockerIds(c.Shockers);
List<string> shockerIds = AddShockerIds();
IntensityRange intensityRange = GetIntensityRange();
DurationRange durationRange = GetDurationRange();
@ -186,6 +186,24 @@ public static class Setup
return new DurationRange(min, max);
}
private static List<string> AddShockerIds()
{
List<string> ids = new();
bool addAnother = true;
while (ids.Count < 1 || addAnother)
{
string id = QueryString("Shocker ID:", "");
while (id.Length < 1)
id = QueryString("Shocker ID:", "");
ids.Add(id);
Console.WriteLine("Add another ID? (Y/N):");
addAnother = Console.ReadKey().Key == ConsoleKey.Y;
}
return ids;
}
private static List<string> GetShockerIds(List<Shocker> shockers)
{
List<string> allShockerIds = new();