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(); } }
public UserControl2(StatePageInfo info, int numStates, int thisState) { parent = info; states = numStates; curState = thisState; InitializeComponent(); this.Dock = DockStyle.Fill; extraBox.SelectedIndex = 0; SetSettings(); SetUI(); }
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(); }
public void SetInfo(StatePageInfo info) { statePageInfo = info; }