public scoutEvents(Match m, int pos) { InitializeComponent(); thisMatch = m; matchPos = pos; eventMain.timeMonitor = timeMonitor; newScout = true; fullScout = new ScoutedInfo(); }
public scoutEvents(ScoutedInfo inf) { InitializeComponent(); eventMain.timeMonitor = timeMonitor; finishBtn.Text = "Save"; newScout = false; fullScout = inf; eventMain.setLocEventList(fullScout); eventParameters.setLocParameters(fullScout); }
/// <summary> /// set everything in this view according to the scouted info provided /// </summary> /// <param name="fullScout"> the scouted info from the match </param> public void setLocParameters(ScoutedInfo fullScout) { CheckAutoInitiation.IsChecked = fullScout.AutoInitiation; climbPicker.SelectedIndex = fullScout.climbPick; CheckConPositional.IsChecked = fullScout.controlPositional; CheckConRotational.IsChecked = fullScout.controlRotational; SlideDeath.Value = fullScout.deathRange; penaltyPicker.SelectedIndex = fullScout.penaltyPick; magnitudeDefendSlider.Value = fullScout.magnitudeDefend; magnitudeDefendedSlider.Value = fullScout.magnitudeDefended; Commentt.Text = fullScout.commentt; }
/// <summary> /// Gives the scouted info object everything entered in this view /// </summary> /// <param name="fullScout"> the scouted info from the match </param> public void setParameters(ScoutedInfo fullScout) { fullScout.AutoInitiation = CheckAutoInitiation.IsChecked; fullScout.climbPick = climbPicker.SelectedIndex; fullScout.controlPositional = CheckConPositional.IsChecked; fullScout.controlRotational = CheckConRotational.IsChecked; fullScout.deathRange = SlideDeath.Value; fullScout.penaltyPick = penaltyPicker.SelectedIndex; fullScout.magnitudeDefend = (int)magnitudeDefendSlider.Value; fullScout.magnitudeDefended = (int)magnitudeDefendedSlider.Value; fullScout.commentt = Commentt.Text; }
/// <summary> /// validate the new match number and set the alliance selection view /// </summary> /// <param name="newNum"></param> private void updateView(string newNum) { Prematching.IsVisible = false; CreateNew.IsEnabled = false; invalidText.IsVisible = true; if (!String.IsNullOrWhiteSpace(newNum) && !String.IsNullOrEmpty(newNum)) { try { matchNumber = int.Parse(newNum); if (matchNumber > 0 && matchNumber <= comp.matchesList.Count) { selectID = -1; int count = 0; for (int i = 0; i < 6; i++) { ScoutedInfo inf = comp.matchesList[matchNumber - 1].TeamsScouted[i]; buttons[i].IsEnabled = inf == null ? true : false; count += inf == null ? 0 : 1; } if (count == 6) { invalidText.Text = "This match is fully scouted, try another one!"; } else { Prematching.IsVisible = true; invalidText.IsVisible = false; } } else { invalidText.Text = "This is not a valid input!"; } } catch (FormatException) { invalidText.Text = "Hold on a second... What did you entered??!"; } } else { invalidText.Text = ":)"; } }
internal void setLocEventList(ScoutedInfo fullScout) { eventList = fullScout.eventList; }
public void setEventList(ScoutedInfo scouted) { scouted.eventList = eventList; }