示例#1
0
        private static void ExitNoConfig()
        {
            var bot = new PokeBotState {
                Connection = new SwitchConnectionConfig {
                    IP = "192.168.0.1", Port = 6000
                }, InitialRoutine = PokeRoutineType.FlexTrade
            };
            var cfg = new ProgramConfig {
                Bots = new[] { bot }
            };
            var created = JsonConvert.SerializeObject(cfg, GetSettings());

            File.WriteAllText(ConfigPath, created);
            Console.WriteLine("Created new config file since none was found in the program's path. Please configure it and restart the program.");
            Console.WriteLine("It is suggested to configure this config file using the GUI project if possible, as it will help you assign values correctly.");
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }
示例#2
0
        private static bool AddBot(PokeBotRunnerImpl env, PokeBotState cfg)
        {
            if (!cfg.IsValid())
            {
                Console.WriteLine($"{cfg}'s config is not valid.");
                return(false);
            }

            var newbot = env.CreateBotFromConfig(cfg);

            try
            {
                env.Add(newbot);
            }
            catch (ArgumentException ex)
            {
                Console.WriteLine(ex.Message);
                return(false);
            }

            Console.WriteLine($"Added: {cfg}: {cfg.InitialRoutine}");
            return(true);
        }
示例#3
0
 public MockExecutor(PokeBotState cfg) : base(cfg)
 {
 }