Big update
This commit is contained in:
@@ -10,6 +10,7 @@ class AccountStats {
|
||||
constructor(data: AccountStatsMongoData) {
|
||||
this.data = data;
|
||||
this.updater = new StatsUpdater();
|
||||
this.updater.use(data);
|
||||
}
|
||||
|
||||
use(data: AccountStatsMongoData) {
|
||||
@@ -21,8 +22,8 @@ class AccountStats {
|
||||
if (this.data) {
|
||||
for (const playerGameResult of playerGameResults) {
|
||||
this.updater.updateStats(playerGameResult, ruleset);
|
||||
this.data.gamesPlayed += 1;
|
||||
}
|
||||
this.data.gamesPlayed += 1;
|
||||
}
|
||||
else {
|
||||
throw new UpdateError(`Cannot update without data! Call the use() method to hydrate the updater with data
|
||||
|
||||
Reference in New Issue
Block a user