private bool ButtonClick(string txt) { BattleshipConsole.AddModule(new MainMenu()); BattleshipConsole.RemoveModule(this); BattleshipConsole.UpdateDisplay(); return(false); }
private bool SelectionConfirm(string btn) { ControllerSkeleton red = null, blue = null; foreach (var bot in selectableBots) { var botName = bot.GetAttribute <NameAttribute>().Name; if (red == null && redGroup.GetSelected() == botName) { red = bot; } if (blue == null && blueGroup.GetSelected() == botName) { blue = bot; } if (red != null && blue != null) { break; } } BattleshipConsole.RemoveModule(this); BattleshipConsole.AddModule(new CompetitionOptionsDisplay(red, blue)); BattleshipConsole.UpdateDisplay(); return(true); }
private bool Exit(string input) { BattleshipConsole.RemoveModule(this); BattleshipConsole.AddModule(new MainMenu()); BattleshipConsole.UpdateDisplay(); return(true); }
private bool ButtonConfirmEvent(string btn) { Configuration.Global.SetValue("mbc_match_rounds", roundsNumberControl.Value.ToString()); var match = new ClassicMatch(); match.PlayerCreate(red); match.PlayerCreate(blue); CompetitionRun runner = new CompetitionRun(match, millisecondControl.Value, showBoards.IsChecked); BattleshipConsole.AddModule(runner); BattleshipConsole.RemoveModule(this); BattleshipConsole.UpdateDisplay(); runner.Begin(); return(true); }
private bool ApplyChanges(string input) { foreach (var control in stringControls) { try { Configuration.Global.SetValue(control.PlaceholderText, control.InputText); } catch { error = control.PlaceholderText; BattleshipConsole.UpdateDisplay(); return(false); } } return(true); }
private bool MenuSelectEvent(string s) { switch (s) { case "Start a competition": BattleshipConsole.RemoveModule(this); BattleshipConsole.AddModule(new BotSelector()); BattleshipConsole.UpdateDisplay(); return(true); case "Configuration Manager": BattleshipConsole.RemoveModule(this); BattleshipConsole.AddModule(new ConfigurationManager()); BattleshipConsole.UpdateDisplay(); return(true); case "Exit": BattleshipConsole.Running = false; return(true); } return(false); }
private void MatchEnd(Event ev) { BattleshipConsole.RemoveModule(this); BattleshipConsole.AddModule(new ResultDisplay(competition)); BattleshipConsole.UpdateDisplay(); }