Example #1
0
        public void SetValues(StatePageInfo info, int currentState)
        {
            info.nType              = nType;
            info.gridType           = gType;
            info.mobile             = mobile;
            info.color              = colorBox.BackColor;
            info.mobileNeighborhood = mobileN;
            info.startingLocations  = startingLocations;
            info.neighbors          = neighbors;
            // Maybe check that the number is valid first?
            if (int.TryParse(agentCount.Text, out int result))
            {
                info.startingAmount = result;
            }
            else
            {
                info.startingAmount = 0;
            }

            info.probs         = probs;
            info.stickingProbs = stickingProbs;
            info.sticking      = sticking;
            info.moveProbs     = moveProbs;
            info.storage       = storage;
            //info.ai = ai;
            info.growth         = growth;
            info.storageObjects = storageObjects;
            if (extra)
            {
                info.containerSettings = e.Retrieve();
            }
        }
Example #2
0
 public UserControl2(StatePageInfo info, int numStates, int thisState)
 {
     parent   = info;
     states   = numStates;
     curState = thisState;
     InitializeComponent();
     this.Dock = DockStyle.Fill;
     extraBox.SelectedIndex = 0;
     SetSettings();
     SetUI();
 }
Example #3
0
        public void UpdateValues(StatePageInfo info, int currentState)
        {
            colorBox.BackColor = info.color.Value;
            agentCount.Text    = info.startingAmount.ToString();
            probs         = info.probs;
            stickingProbs = info.stickingProbs;
            sticking      = info.sticking.Value;
            moveProbs     = info.moveProbs;
            storage       = info.storage.Value;
            //ai = info.ai.Value;
            growth            = info.growth.Value;
            storageObjects    = info.storageObjects;
            startingLocations = info.startingLocations;
            mobileN           = info.mobileNeighborhood.Value;
            switch (info.nType)
            {
            case NType.None:
                neighborBox.SelectedIndex = 0;
                break;

            case NType.VonNeumann:
                neighborBox.SelectedIndex = 1;
                break;

            case NType.Moore:
                neighborBox.SelectedIndex = 2;
                break;

            case NType.Hybrid:
                neighborBox.SelectedIndex = 3;
                break;

            case NType.Advanced:
                neighborBox.SelectedIndex = 4;
                break;
            }
            switch (info.gridType)
            {
            case GridType.Box:
                edgeBox.SelectedIndex = 0;
                break;

            case GridType.CylinderH:
                edgeBox.SelectedIndex = 1;
                break;

            case GridType.CylinderW:
                edgeBox.SelectedIndex = 2;
                break;

            case GridType.Torus:
                edgeBox.SelectedIndex = 3;
                break;
            }
            switch (info.mobile)
            {
            case false:
                mobilityBox.SelectedIndex = 0;
                break;

            case true:
                mobilityBox.SelectedIndex = 1;
                break;
            }
            RefreshNeighborFields();
            RefreshMobilityButtons();
        }
Example #4
0
 public void SetInfo(StatePageInfo info)
 {
     statePageInfo = info;
 }