public ConfigurationManager()
        {
            stringControls = new List<StringInputControl>();
            leftLayout = new VerticalLayout(VerticalLayout.VerticalAlign.Left);
            rightLayout = new VerticalLayout(VerticalLayout.VerticalAlign.Right);
            centerLayout = new VerticalLayout(VerticalLayout.VerticalAlign.Center);
            error = null;

            var configKeys = Configuration.GetAllKnownKeys();
            for (int i = 0; i < configKeys.Count / 2; i++)
            {
                var stringControl = CreateConfigInput(configKeys[i]);
                leftLayout.Add(stringControl);
                stringControls.Add(stringControl);
            }
            for (int i = configKeys.Count / 2; i < configKeys.Count; i++)
            {
                var stringControl = CreateConfigInput(configKeys[i]);
                rightLayout.Add(stringControl);
                stringControls.Add(stringControl);
            }

            applyButton = new ButtonControl("Apply changes", ApplyChanges);
            centerLayout.Add(applyButton);
            centerLayout.Add(new ButtonControl("Save changes to file", SaveChanges));
            centerLayout.Add(new ButtonControl("Exit", Exit));
            AddControlLayout(leftLayout);
            AddControlLayout(rightLayout);
            AddControlLayout(centerLayout);
        }
Exemple #2
0
 public MainMenu()
 {
     menuLayout = new VerticalLayout(VerticalLayout.VerticalAlign.Center);
     menuLayout.Add(new ButtonControl("Start a competition", MenuSelectEvent));
     //menuLayout.Add(new ButtonControl("Configuration Manager", MenuSelectEvent));
     menuLayout.Add(new ButtonControl("Exit", MenuSelectEvent));
     AddControlLayout(menuLayout);
 }
 public CompetitionOptionsDisplay(ControllerSkeleton red, ControllerSkeleton blue)
 {
     this.red = red;
     this.blue = blue;
     layout = new VerticalLayout(VerticalLayout.VerticalAlign.Center);
     roundsNumberControl = new NumericControl(new NumericControl.NumericControlParameters("# of rounds", false, 1, 100000, 10, 1000));
     millisecondControl = new NumericControl(new NumericControl.NumericControlParameters("Millisecond delay", false, 0, 10000, 5, 0));
     showBoards = new CheckboxControl("Show ASCII boards");
     layout.Add(roundsNumberControl);
     //layout.Add(new CheckboxControl("Play out rounds"));
     layout.Add(millisecondControl);
     layout.Add(showBoards);
     layout.Add(new ButtonControl("Confirm", ButtonConfirmEvent));
     AddControlLayout(layout);
 }
        public BotSelector()
        {
            LoadControllers();

            redList = new VerticalLayout(VerticalLayout.VerticalAlign.Left);
            redList.SetDisplayLine(5);
            redGroup = new RadioButtonControlGroup(redList);
            foreach (var ctrl in selectableBots)
            {
                redGroup.AddRadioButton(ctrl.GetAttribute<NameAttribute>().Name);
            }

            blueList = new VerticalLayout(VerticalLayout.VerticalAlign.Right);
            blueList.SetDisplayLine(5);
            blueGroup = new RadioButtonControlGroup(blueList);
            foreach (var ctrl in selectableBots)
            {
                blueGroup.AddRadioButton(ctrl.GetAttribute<NameAttribute>().Name);
            }

            buttonConfirmLayout = new VerticalLayout(VerticalLayout.VerticalAlign.Center);
            buttonConfirmLayout.SetDisplayLine(6 + selectableBots.Count);
            buttonConfirmLayout.Add(new ButtonControl("Confirm", SelectionConfirm));

            AddControlLayout(redList);
            AddControlLayout(blueList);
            AddControlLayout(buttonConfirmLayout);
        }
        public ResultDisplay(MatchCore comp)
        {
            competition = comp;

            buttonLayout = new VerticalLayout(VerticalLayout.VerticalAlign.Center);
            buttonLayout.Add(new ButtonControl("Back to Main Menu", ButtonClick));

            AddControlLayout(buttonLayout);
        }