public void FillInRestOfColors() //this means fill rest of colors is no problem. { var thisList = ColorsLeft(); thisList.ShuffleList(); if (PlayerList.Any(x => x.DidChooseColor == false && x.InGame == true)) { throw new BasicBlankException("There is at least one player who did not choose color who is in game. That is wrong"); } CustomBasicList <P> tempList = PlayerList.Where(Items => Items.DidChooseColor == false).ToCustomBasicList(); tempList.ShuffleList(); //i am guessing in this case, you have to literally have them match. if (thisList.Count != tempList.Count) { throw new BasicBlankException("Does not match. Therefore, can't populate the rest of the colors"); } tempList.ForEach(thisPlayer => { thisPlayer.Color = thisList[tempList.IndexOf(thisPlayer)].EnumValue; }); }
public static bool HasYears(this PlayerCollection <LifeCardGamePlayerItem> thisList) { return(thisList.Any(thisPlayer => thisPlayer.MainHandList.Any(thisCard => thisCard.Points == 0))); }