Exemplo n.º 1
0
        public bool RemoveBetter(Better better)
        {
            bool betterWasRemoved = Betters.Remove(better);

            if (betterWasRemoved)
            {
                better.MarkForDeletion();
            }

            return(betterWasRemoved);
        }
Exemplo n.º 2
0
        public Better AddBetter(User user)
        {
            bool betterAlreadyExists = GetBetterByName(user.Name) != null;

            if (betterAlreadyExists)
            {
                return(null);
            }

            Betters.Add(Better.Create(user, this));
            return(Betters.Last());
        }
Exemplo n.º 3
0
 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);
     }
 }
Exemplo n.º 4
0
 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);
     }
 }
Exemplo n.º 5
0
 public Better GetBetterByName(string name)
 {
     return(Betters.FirstOrDefault(better => better.User.Name.ToLower() == name.ToLower()));
 }
Exemplo n.º 6
0
 public Better GetBetterById(Guid id)
 {
     return(Betters.FirstOrDefault(better => better.Id == id));
 }