Beispiel #1
0
        public static EditNeuronGeneListForm ShowDialogue(Window window, List <RMP_NeuronGene> _neuronList, GenerateNeuronsEvent generateNeurons, CloseEvent closeFunction = null, string category = null, ISkinFile file = null)
        {
            var form = new EditNeuronGeneListForm();

            form.Initialize(_neuronList, generateNeurons, closeFunction, "Edit Neuron-gene list", true, true, category, file);
            form.Show(window);

            return(form);
        }
Beispiel #2
0
        public override void AddedToContainer()
        {
            base.AddedToContainer();

            var builder = new FieldBuilder();

            builder.BuildSessionStart(this);

            EditNeuronGeneListForm.GenerateNeuronsEvent addNeuronsDelegate = delegate(int neuronsToAdd, List <RMP_NeuronGene> neuronList)
            {
                AddRandomNeurons(neuronList, neuronsToAdd);
            };

            builder.AddResizableButtonField("Edit Red Eye-Neurons", delegate(object sender)
            {
                EditNeuronGeneListForm.ShowDialogue(Parent, chromosome.EyeRNeuronGenes, addNeuronsDelegate);
            }, FieldBuilder.ResizableButtonOrientation.FillWidth);

            builder.AddResizableButtonField("Edit Green Eye-Neurons", delegate(object sender)
            {
                EditNeuronGeneListForm.ShowDialogue(Parent, chromosome.EyeGNeuronGenes, addNeuronsDelegate);
            }, FieldBuilder.ResizableButtonOrientation.FillWidth);

            builder.AddResizableButtonField("Edit Blue Eye-Neurons", delegate(object sender)
            {
                EditNeuronGeneListForm.ShowDialogue(Parent, chromosome.EyeBNeuronGenes, addNeuronsDelegate);
            }, FieldBuilder.ResizableButtonOrientation.FillWidth);

            builder.AddResizableButtonField("Edit Distance Eye-Neurons", delegate(object sender)
            {
                EditNeuronGeneListForm.ShowDialogue(Parent, chromosome.DistanceNeuronGenes, addNeuronsDelegate);
            }, FieldBuilder.ResizableButtonOrientation.FillWidth);

            builder.AddVerticalMargin(4);

            builder.AddResizableButtonField("Edit Input-Neurons", delegate(object sender)
            {
                EditNeuronGeneListForm.ShowDialogue(Parent, chromosome.InputNeuronGenes, addNeuronsDelegate);
            }, FieldBuilder.ResizableButtonOrientation.FillWidth);

            builder.AddResizableButtonField("Edit Hidden-Neurons", delegate(object sender)
            {
                EditNeuronGeneListForm.ShowDialogue(Parent, chromosome.HiddenNeuronGenes, addNeuronsDelegate);
            }, FieldBuilder.ResizableButtonOrientation.FillWidth);

            builder.AddResizableButtonField("Edit Output-Neurons", delegate(object sender)
            {
                EditNeuronGeneListForm.ShowDialogue(Parent, chromosome.OutputNeuronGenes, delegate(int neuronsToAdd, List <RMP_NeuronGene> neuronList)
                {
                    AddRandomOutputNeurons(neuronList, neuronsToAdd);
                });
            }, FieldBuilder.ResizableButtonOrientation.FillWidth);

            builder.AddVerticalMargin(5);

            builder.AddResizableButtonField("Connect Randomly", delegate(object sender)
            {
                chromosome.AllNeuronsConnectRandomly();
            }, FieldBuilder.ResizableButtonOrientation.FillWidth);

            builder.BuildSessionEnd();

            X = (Parent.Width / 2) - (Width / 2);
            Y = (Parent.Height / 2) - (Height / 2);

            CanResizeFormVertically = false;
        }