public TradeUpForm(DraftModel draftModel, DraftForm draftForm, TradeOffer tradeOffer) { dm = draftModel; df = draftForm; dm.tradeUpForm = this; HigherCON = dm.model.TeamModel.GetTeamRecord(df.CurrentSelectingId).CON; LowerCON = dm.model.TeamModel.GetTeamRecord(dm.HumanTeamId).CON; InitializeComponent(); ourteam = dm.model.TeamModel.GetTeamNameFromTeamId(dm.HumanTeamId); theirteam = dm.model.TeamModel.GetTeamNameFromTeamId(df.CurrentSelectingId); myLabel.Text = ourteam + "' Picks"; CPUlabel.Text = theirteam + "' Picks"; to = tradeOffer; foreach (int pick in to.lowerAvailable) { myPicksList.Add(pick); } theirPicksList.Add(to.pickNumber); foreach (int pick in to.higherAvailable) { theirPicksList.Add(pick); } for (int i = 1; i <= 7; i++) { if (!dm.futureTradedPicks[to.LowerTeam].ContainsKey(i)) { myPicksList.Add(1000 + i); } } if (to.allowFuturePicksFromHigher) { // This was preventing all future draft picks from being eligible to be traded // changed to 1 instead of startRound //int startRound = to.pickNumber / 32 + 3; for (int i = 1; i <= 7; i++) { if (!dm.futureTradedPicks[to.HigherTeam].ContainsKey(i)) { theirPicksList.Add(1000 + i); } } } refreshPickLists(); offerButton.Enabled = false; resetButton.Enabled = false; refreshTotals(); }
public TradeDownForm(DraftModel draftModel, DraftForm draftForm, TradeOffer to) { activeTeam = to.LowerTeam; HumanTeam = to.HigherTeam; dm = draftModel; df = draftForm; dm.tradeDownForm = this; InitializeComponent(); for (int i = 0; i < 32; i++) { nextpicks[i] = dm.GetNextPick(i, df.CurrentPick) + 1; teamnames[i] = dm.model.TeamModel.GetTeamNameFromTeamId(i); cons[i] = dm.model.TeamModel.GetTeamRecord(i).CON; conversations[i] = new List <string>(); } for (int i = 0; i < 32; i++) { if (i == HumanTeam) { continue; } int lowestPick = 300; int nextTeam = -1; foreach (KeyValuePair <int, int> pick in nextpicks) { if (pick.Value < lowestPick && !teamsByNextPick.Contains(pick.Key)) { lowestPick = pick.Value; nextTeam = pick.Key; } } teamsByNextPick.Add(nextTeam); } myLabel.Text = teamnames[HumanTeam] + "' Picks"; CPUlabel.Text = teamnames[activeTeam] + "' Picks"; picksList[to.HigherTeam] = new List <int>(); picksList[to.HigherTeam].Add(to.pickNumber); foreach (int pick in to.higherAvailable) { picksList[to.HigherTeam].Add(pick); } for (int i = 1; i <= 7; i++) { if (!dm.futureTradedPicks[to.HigherTeam].ContainsKey(i)) { picksList[to.HigherTeam].Add(1000 + i); } } FillTeamBoxes(); FillPickLists(activeTeam); RefreshPickBoxes(); selectPrevious(); }