public void Add(DatabaseSingleLevelStats other) { NumGames += other.NumGames; NumPositions += other.NumPositions; TotalWhiteElo += other.TotalWhiteElo; TotalBlackElo += other.TotalBlackElo; if (NumGamesWithElo == 0) { MinElo = other.MinElo; MaxElo = other.MaxElo; } else if (other.NumGamesWithElo != 0) { MinElo = Math.Min(MinElo, other.MinElo); MaxElo = Math.Min(MaxElo, other.MaxElo); } if (NumGamesWithDate == 0) { MinDate = other.MinDate; MaxDate = other.MaxDate; } else if (other.NumGamesWithDate != 0) { MinDate = Date.Min(MinDate, other.MinDate); MaxDate = Date.Max(MaxDate, other.MaxDate); } NumGamesWithElo += other.NumGamesWithElo; NumGamesWithDate += other.NumGamesWithDate; }
public DatabaseSingleLevelStats GetTotal() { DatabaseSingleLevelStats total = new DatabaseSingleLevelStats(StatsByLevel[GameLevel.Engine]); total.Add(StatsByLevel[GameLevel.Human]); total.Add(StatsByLevel[GameLevel.Server]); return(total); }
public DatabaseSingleLevelStats(DatabaseSingleLevelStats other) { NumGames = other.NumGames; NumPositions = other.NumPositions; TotalWhiteElo = other.TotalWhiteElo; TotalBlackElo = other.TotalBlackElo; NumGamesWithElo = other.NumGamesWithElo; NumGamesWithDate = other.NumGamesWithDate; MinElo = other.MinElo; MaxElo = other.MaxElo; MinDate = other.MinDate; MaxDate = other.MaxDate; }