protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.ListBoxBankAccounts.DataSource = this.appData.Accounts.All().Where(a => a.OwnerId == this.currentUserId).ToList(); this.ListBoxBankAccounts.DataBind(); this.ListBoxCardTypes.DataSource = CardType.GetValues(typeof(CardType)).Cast <CardType>().Select((val, i) => new { Id = i, Name = val }).ToList(); this.ListBoxCardTypes.DataBind(); } }
public bool CheckWin(List <Card> cards) { bool win = false; var cardTypes = CardType.GetValues(typeof(CardType)).Cast <CardType>(); foreach (CardType ct in cardTypes) { if (ct != CardType.None) { win = CheckEnoughCardsOfType(ct, cards); if (!win) { return(false); } } } if (win) { return(true); } return(false); }