INNER CODE UNIT · C#
GetRunner
kwsch/SysBot.NET · SysBot.Pokemon.ConsoleApp/Program.cs:111
private static IPokeBotRunner GetRunner(ProgramConfig prog) => prog.Mode switch
{
ProgramMode.SWSH => new PokeBotRunnerImpl<PK8>(prog.Hub, new BotFactory8SWSH()),
ProgramMode.BDSP => new PokeBotRunnerImpl<PB8>(prog.Hub, new BotFactory8BS()),
ProgramMode.LA => new PokeBotRunnerImpl<PA8>(prog.Hub, new BotFactory8LA()),
ProgramMode.SV => new PokeBotRunnerImpl<PK9>(prog.Hub, new BotFactory9SV()),
ProgramMode.LZA => new PokeBotRunnerImpl<PA9>(prog.Hub, new BotFactory9LZA()),
_ => throw new IndexOutOfRangeException("Unsupported mode."),
};
private static bool AddBot(IPokeBotRunner env, PokeBotState cfg, ProgramMode mode)
{
if (!cfg.IsValid())
{
Console.WriteLine($"{cfg}'s config is not valid.");
return false;
}