public void Add(DatabaseSingleLevelStats other)
        {
            this.NumGames      += other.NumGames;
            this.NumPositions  += other.NumPositions;
            this.TotalWhiteElo += other.TotalWhiteElo;
            this.TotalBlackElo += other.TotalBlackElo;

            if (this.NumGamesWithElo == 0)
            {
                this.MinElo = other.MinElo;
                this.MaxElo = other.MaxElo;
            }
            else if (other.NumGamesWithElo != 0)
            {
                this.MinElo = Math.Min(this.MinElo, other.MinElo);
                this.MaxElo = Math.Min(this.MaxElo, other.MaxElo);
            }

            if (this.NumGamesWithDate == 0)
            {
                this.MinDate = other.MinDate;
                this.MaxDate = other.MaxDate;
            }
            else if (other.NumGamesWithDate != 0)
            {
                this.MinDate = Date.Min(this.MinDate, other.MinDate);
                this.MaxDate = Date.Max(this.MaxDate, other.MaxDate);
            }

            this.NumGamesWithElo  += other.NumGamesWithElo;
            this.NumGamesWithDate += other.NumGamesWithDate;
        }
        public DatabaseSingleLevelStats GetTotal()
        {
            DatabaseSingleLevelStats total = new DatabaseSingleLevelStats(this.StatsByLevel[GameLevel.Engine]);

            total.Add(this.StatsByLevel[GameLevel.Human]);
            total.Add(this.StatsByLevel[GameLevel.Server]);
            return(total);
        }
 public DatabaseSingleLevelStats(DatabaseSingleLevelStats other)
 {
     this.NumGames         = other.NumGames;
     this.NumPositions     = other.NumPositions;
     this.TotalWhiteElo    = other.TotalWhiteElo;
     this.TotalBlackElo    = other.TotalBlackElo;
     this.NumGamesWithElo  = other.NumGamesWithElo;
     this.NumGamesWithDate = other.NumGamesWithDate;
     this.MinElo           = other.MinElo;
     this.MaxElo           = other.MaxElo;
     this.MinDate          = other.MinDate;
     this.MaxDate          = other.MaxDate;
 }