volleyballsimtypes 0.0.23 → 0.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,4 +17,5 @@ export declare class Season {
17
17
  champion?: Team;
18
18
  constructor({ id, iteration, teams, matches, champion }: SeasonOpts);
19
19
  calculateStandings(): Standing[];
20
+ updateStandings(): void;
20
21
  }
@@ -18,5 +18,12 @@ class Season {
18
18
  return standing;
19
19
  }).sort(standing_1.Standing.sortFn);
20
20
  }
21
+ updateStandings() {
22
+ this.standings.length = 0;
23
+ this.standings.push(...this.calculateStandings());
24
+ if (this.matches.every((match) => match.isSimulated)) {
25
+ this.champion = this.teams.find((team) => team.id === this.standings[0].teamId);
26
+ }
27
+ }
21
28
  }
22
29
  exports.Season = Season;
@@ -17,4 +17,5 @@ export declare class Season {
17
17
  champion?: Team;
18
18
  constructor({ id, iteration, teams, matches, champion }: SeasonOpts);
19
19
  calculateStandings(): Standing[];
20
+ updateStandings(): void;
20
21
  }
@@ -15,4 +15,11 @@ export class Season {
15
15
  return standing;
16
16
  }).sort(Standing.sortFn);
17
17
  }
18
+ updateStandings() {
19
+ this.standings.length = 0;
20
+ this.standings.push(...this.calculateStandings());
21
+ if (this.matches.every((match) => match.isSimulated)) {
22
+ this.champion = this.teams.find((team) => team.id === this.standings[0].teamId);
23
+ }
24
+ }
18
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volleyballsimtypes",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "description": "vbsim types",
5
5
  "main": "./dist/cjs/src/index.js",
6
6
  "module": "./dist/esm/src/index.js",