volleyballsimtypes 0.0.28 → 0.0.29
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.
|
@@ -8,8 +8,8 @@ class Season {
|
|
|
8
8
|
this.teams = teams;
|
|
9
9
|
this.matches = matches;
|
|
10
10
|
this.iteration = iteration;
|
|
11
|
-
this.standings = this.calculateStandings();
|
|
12
11
|
this.champion = champion;
|
|
12
|
+
this.standings = this.calculateStandings();
|
|
13
13
|
}
|
|
14
14
|
calculateStandings() {
|
|
15
15
|
return this.teams.map(team => {
|
|
@@ -19,6 +19,8 @@ class Season {
|
|
|
19
19
|
}).sort(standing_1.Standing.sortFn);
|
|
20
20
|
}
|
|
21
21
|
updateStandings() {
|
|
22
|
+
if (this.matches == null || this.matches.length < 1)
|
|
23
|
+
throw new Error('NO_MATCHES');
|
|
22
24
|
this.standings.length = 0;
|
|
23
25
|
this.standings.push(...this.calculateStandings());
|
|
24
26
|
if (this.matches.every((match) => match.isSimulated)) {
|
|
@@ -5,8 +5,8 @@ export class Season {
|
|
|
5
5
|
this.teams = teams;
|
|
6
6
|
this.matches = matches;
|
|
7
7
|
this.iteration = iteration;
|
|
8
|
-
this.standings = this.calculateStandings();
|
|
9
8
|
this.champion = champion;
|
|
9
|
+
this.standings = this.calculateStandings();
|
|
10
10
|
}
|
|
11
11
|
calculateStandings() {
|
|
12
12
|
return this.teams.map(team => {
|
|
@@ -16,6 +16,8 @@ export class Season {
|
|
|
16
16
|
}).sort(Standing.sortFn);
|
|
17
17
|
}
|
|
18
18
|
updateStandings() {
|
|
19
|
+
if (this.matches == null || this.matches.length < 1)
|
|
20
|
+
throw new Error('NO_MATCHES');
|
|
19
21
|
this.standings.length = 0;
|
|
20
22
|
this.standings.push(...this.calculateStandings());
|
|
21
23
|
if (this.matches.every((match) => match.isSimulated)) {
|