private void AddBot() { var dialog = new OpenFileDialog(); dialog.Filter = "C# assemblies (*.dll)|*.dll"; dialog.Multiselect = true; if (dialog.ShowDialog() == true) { foreach (var fileName in dialog.FileNames) { if (!IsAssemblyValid(fileName)) { Logs.Add("Invalid assembly"); continue; } Logs.Add("Bot loaded"); BotInformations.Add(new BotInfoModel { Path = fileName, TeamName = ExtractTeamName(fileName) }); } } }
private void StartSimulation() { var simulator = new SimulatorWindow(); simulator.Show(new GameConfiguration { BotPathList = BotInformations.Select(b => b.Path).ToList(), BotsPerTeam = int.Parse(Configuration.BotsPerTeam), GameType = int.Parse(Configuration.GameType), MapPath = Configuration.MapPath, NumberOfTurns = int.Parse(Configuration.NumberOfTurns), Speed = int.Parse(Configuration.Interval) }); }