I am trying to create a draft order for a game I'm working on but I cannot get it to function how I need it to. I need 5 rounds with each round number properly and each pick should be numbered 1-10 for each round. Here is the code I'm working with:
List<Draft> _draftorder = new List<Draft>();
foreach (Team t in teams)
{
for (int i = 1; i <= 5; i++)
{
_draftorder.Add(new Draft()
{
city = t.city,
round = i++,
pick = i++,
});
}
}
Any help is appreciated!
i++increases the value stored ini, so you are adding 1 to it three times within theforloopRoundandPickshould always be the same perDraftobject?