public bool RemoveBetter(Better better) { bool betterWasRemoved = Betters.Remove(better); if (betterWasRemoved) { better.MarkForDeletion(); } return(betterWasRemoved); }
public Better AddBetter(User user) { bool betterAlreadyExists = GetBetterByName(user.Name) != null; if (betterAlreadyExists) { return(null); } Betters.Add(Better.Create(user, this)); return(Betters.Last()); }
void CreateBetterlist(List <string> betters, ISubmittedBets sb, IResults actual) { foreach (var better in betters) { var score = new ScoringSystem(sb.GetSingleBet(better), actual); var bet = new Better() { Name = better, Score = score.GetTotal() }; var achievements = new AchievementSystem(sb.GetSingleBet(better), actual); bet.Achievements = achievements.Achievements; bet.RowClass = "normal"; Betters.Add(bet); } }
void CreateBetterlist(List <string> betters, ISubmittedBets sb, IResultCollection rc) { foreach (var better in betters) { var score = new ScoringSystem(sb.GetSingleBet(better), rc.Current); var oldscore = new ScoringSystem(sb.GetSingleBet(better), rc.Previous); var bet = new Better() { Name = better, Score = score.GetTotal(), OldScore = oldscore.GetTotal() }; var achievements = new AchievementSystem(sb.GetSingleBet(better), rc.Current); bet.Achievements = achievements.Achievements; bet.RowClass = "normal"; Betters.Add(bet); } }
public Better GetBetterByName(string name) { return(Betters.FirstOrDefault(better => better.User.Name.ToLower() == name.ToLower())); }
public Better GetBetterById(Guid id) { return(Betters.FirstOrDefault(better => better.Id == id)); }