private void MainForm_Load(object sender, EventArgs e)
        {
            Commands = CommandsCreator.Execute();

            cbCommands.DataSource    = Commands.Select(x => new { x.Name, x.SysName }).ToList();
            cbCommands.DisplayMember = "Name";
            cbCommands.ValueMember   = "SysName";
            cbCommands.Enabled       = true;
        }
Esempio n. 2
0
 public AddCommandMutation(Random random, ICommandsList commands)
 {
     _random   = random;
     _commands = commands;
     _creator  = new CommandsCreator(random, commands);
     _added    = new Stack <AddCommand>();
     _handlers = new List <Action <int> >
     {
         AddNewInt,
         AddCloneValue,
         AddConditionBlock,
         AddGetRandom,
         AddGetState,
         AddMinus,
         AddPlus,
         AddPrint,
         AddSetValue,
         AddStop
     };
 }
Esempio n. 3
0
 public ReplaceCommandMutation(Random random, ICommandsList commands)
 {
     _commands = commands;
     _random   = random;
     _creator  = new CommandsCreator(random, commands);
     _handlers = new List <Func <int, ICommand> >
     {
         _creator.CreateCloseCondition,
         _creator.CreateCloneValue,
         _creator.CreateCondition,
         _creator.CreateGetRandom,
         _creator.CreateGetState,
         _creator.CreateMinus,
         _creator.CreateNewInt,
         _creator.CreatePlus,
         _creator.CreatePrint,
         _creator.CreateSetValue,
         _creator.CreateStop
     };
 }
 public ReplaceCommandMutation(Random random, ICommandsList commands)
 {
     _commands = commands;
     _random = random;
     _creator = new CommandsCreator(random, commands);
     _handlers = new List<Func<int, ICommand>>
     {
         _creator.CreateCloseCondition,
         _creator.CreateCloneValue,
         _creator.CreateCondition,
         _creator.CreateGetRandom,
         _creator.CreateGetState,
         _creator.CreateMinus,
         _creator.CreateNewInt,
         _creator.CreatePlus,
         _creator.CreatePrint,
         _creator.CreateSetValue,
         _creator.CreateStop
     };
 }
 public static void AddToCommandList(CommandsCreator commandsCreator)
 {
     cc.Add(commandsCreator);
 }