volleyballsimtypes 0.0.27 → 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.
- package/dist/cjs/src/data/models/league.d.ts +2 -2
- package/dist/cjs/src/data/models/match-set.d.ts +4 -4
- package/dist/cjs/src/data/models/player.d.ts +2 -2
- package/dist/cjs/src/data/models/rally.d.ts +9 -9
- package/dist/cjs/src/data/models/season.d.ts +2 -2
- package/dist/cjs/src/data/models/team.d.ts +2 -2
- package/dist/cjs/src/data/models/tournament-match.d.ts +1 -1
- package/dist/cjs/src/service/league/season.js +3 -1
- package/dist/cjs/src/service/match/match-set.d.ts +1 -1
- package/dist/cjs/src/service/match/rally.d.ts +1 -1
- package/dist/cjs/src/service/tournament/tournament.d.ts +1 -0
- package/dist/cjs/src/service/tournament/tournament.js +9 -0
- package/dist/esm/src/data/models/league.d.ts +2 -2
- package/dist/esm/src/data/models/match-set.d.ts +4 -4
- package/dist/esm/src/data/models/player.d.ts +2 -2
- package/dist/esm/src/data/models/rally.d.ts +9 -9
- package/dist/esm/src/data/models/season.d.ts +2 -2
- package/dist/esm/src/data/models/team.d.ts +2 -2
- package/dist/esm/src/data/models/tournament-match.d.ts +1 -1
- package/dist/esm/src/service/league/season.js +3 -1
- package/dist/esm/src/service/match/match-set.d.ts +1 -1
- package/dist/esm/src/service/match/rally.d.ts +1 -1
- package/dist/esm/src/service/tournament/tournament.d.ts +1 -0
- package/dist/esm/src/service/tournament/tournament.js +9 -0
- package/package.json +1 -1
|
@@ -18,11 +18,12 @@ export declare class LeagueModel extends Model<LeagueAttributes, LeagueCreationA
|
|
|
18
18
|
league_id: string;
|
|
19
19
|
country_id: string;
|
|
20
20
|
name: string;
|
|
21
|
+
Teams: TeamModel[];
|
|
22
|
+
Seasons: SeasonModel[];
|
|
21
23
|
country: CountryModel;
|
|
22
24
|
getCountry: Sequelize.BelongsToGetAssociationMixin<CountryModel>;
|
|
23
25
|
setCountry: Sequelize.BelongsToSetAssociationMixin<CountryModel, CountryId>;
|
|
24
26
|
createCountry: Sequelize.BelongsToCreateAssociationMixin<CountryModel>;
|
|
25
|
-
Seasons: SeasonModel[];
|
|
26
27
|
getSeasons: Sequelize.HasManyGetAssociationsMixin<SeasonModel>;
|
|
27
28
|
setSeasons: Sequelize.HasManySetAssociationsMixin<SeasonModel, SeasonId>;
|
|
28
29
|
addSeason: Sequelize.HasManyAddAssociationMixin<SeasonModel, SeasonId>;
|
|
@@ -33,7 +34,6 @@ export declare class LeagueModel extends Model<LeagueAttributes, LeagueCreationA
|
|
|
33
34
|
hasSeason: Sequelize.HasManyHasAssociationMixin<SeasonModel, SeasonId>;
|
|
34
35
|
hasSeasons: Sequelize.HasManyHasAssociationsMixin<SeasonModel, SeasonId>;
|
|
35
36
|
countSeasons: Sequelize.HasManyCountAssociationsMixin;
|
|
36
|
-
Teams: TeamModel[];
|
|
37
37
|
getTeams: Sequelize.HasManyGetAssociationsMixin<TeamModel>;
|
|
38
38
|
setTeams: Sequelize.HasManySetAssociationsMixin<TeamModel, TeamId>;
|
|
39
39
|
addTeam: Sequelize.HasManyAddAssociationMixin<TeamModel, TeamId>;
|
|
@@ -24,16 +24,17 @@ export declare class MatchSetModel extends Model<MatchSetAttributes, MatchSetCre
|
|
|
24
24
|
match_set_id: string;
|
|
25
25
|
match_id: string;
|
|
26
26
|
is_tie_break: boolean;
|
|
27
|
-
home_libero?: string;
|
|
28
|
-
away_libero?: string;
|
|
29
27
|
order: number;
|
|
30
28
|
home_score: number;
|
|
31
29
|
away_score: number;
|
|
30
|
+
home_libero?: string;
|
|
31
|
+
away_libero?: string;
|
|
32
|
+
Rallies: RallyModel[];
|
|
33
|
+
MatchSetStats: MatchSetStatsModel[];
|
|
32
34
|
match: MatchModel;
|
|
33
35
|
getMatch: Sequelize.BelongsToGetAssociationMixin<MatchModel>;
|
|
34
36
|
setMatch: Sequelize.BelongsToSetAssociationMixin<MatchModel, MatchId>;
|
|
35
37
|
createMatch: Sequelize.BelongsToCreateAssociationMixin<MatchModel>;
|
|
36
|
-
MatchSetStats: MatchSetStatsModel[];
|
|
37
38
|
getMatchSetStats: Sequelize.HasManyGetAssociationsMixin<MatchSetStatsModel>;
|
|
38
39
|
setMatchSetStats: Sequelize.HasManySetAssociationsMixin<MatchSetStatsModel, MatchSetStatsId>;
|
|
39
40
|
addMatchSetStat: Sequelize.HasManyAddAssociationMixin<MatchSetStatsModel, MatchSetStatsId>;
|
|
@@ -55,7 +56,6 @@ export declare class MatchSetModel extends Model<MatchSetAttributes, MatchSetCre
|
|
|
55
56
|
hasPlayer_id_Player: Sequelize.BelongsToManyHasAssociationMixin<PlayerModel, PlayerId>;
|
|
56
57
|
hasPlayer_id_Players: Sequelize.BelongsToManyHasAssociationsMixin<PlayerModel, PlayerId>;
|
|
57
58
|
countPlayer_id_Players: Sequelize.BelongsToManyCountAssociationsMixin;
|
|
58
|
-
Rallies: RallyModel[];
|
|
59
59
|
getRallies: Sequelize.HasManyGetAssociationsMixin<RallyModel>;
|
|
60
60
|
setRallies: Sequelize.HasManySetAssociationsMixin<RallyModel, RallyId>;
|
|
61
61
|
addRally: Sequelize.HasManyAddAssociationMixin<RallyModel, RallyId>;
|
|
@@ -42,6 +42,8 @@ export declare class PlayerModel extends Model<PlayerAttributes, PlayerCreationA
|
|
|
42
42
|
country_id: string;
|
|
43
43
|
team_id: string;
|
|
44
44
|
traits: TraitType[];
|
|
45
|
+
PerformanceStat: PerformanceStatsModel;
|
|
46
|
+
MatchSetStats: MatchSetStatsModel[];
|
|
45
47
|
country: CountryModel;
|
|
46
48
|
getCountry: Sequelize.BelongsToGetAssociationMixin<CountryModel>;
|
|
47
49
|
setCountry: Sequelize.BelongsToSetAssociationMixin<CountryModel, CountryId>;
|
|
@@ -156,7 +158,6 @@ export declare class PlayerModel extends Model<PlayerAttributes, PlayerCreationA
|
|
|
156
158
|
hasMatch_set_id_MatchSet: Sequelize.BelongsToManyHasAssociationMixin<MatchSetModel, MatchSetId>;
|
|
157
159
|
hasMatch_set_id_MatchSets: Sequelize.BelongsToManyHasAssociationsMixin<MatchSetModel, MatchSetId>;
|
|
158
160
|
countMatch_set_id_MatchSets: Sequelize.BelongsToManyCountAssociationsMixin;
|
|
159
|
-
MatchSetStats: MatchSetStatsModel[];
|
|
160
161
|
getMatchSetStats: Sequelize.HasManyGetAssociationsMixin<MatchSetStatsModel>;
|
|
161
162
|
setMatchSetStats: Sequelize.HasManySetAssociationsMixin<MatchSetStatsModel, MatchSetStatsId>;
|
|
162
163
|
addMatchSetStat: Sequelize.HasManyAddAssociationMixin<MatchSetStatsModel, MatchSetStatsId>;
|
|
@@ -167,7 +168,6 @@ export declare class PlayerModel extends Model<PlayerAttributes, PlayerCreationA
|
|
|
167
168
|
hasMatchSetStat: Sequelize.HasManyHasAssociationMixin<MatchSetStatsModel, MatchSetStatsId>;
|
|
168
169
|
hasMatchSetStats: Sequelize.HasManyHasAssociationsMixin<MatchSetStatsModel, MatchSetStatsId>;
|
|
169
170
|
countMatchSetStats: Sequelize.HasManyCountAssociationsMixin;
|
|
170
|
-
PerformanceStat: PerformanceStatsModel;
|
|
171
171
|
getPerformanceStat: Sequelize.HasOneGetAssociationMixin<PerformanceStatsModel>;
|
|
172
172
|
setPerformanceStat: Sequelize.HasOneSetAssociationMixin<PerformanceStatsModel, PerformanceStatsId>;
|
|
173
173
|
createPerformanceStat: Sequelize.HasOneCreateAssociationMixin<PerformanceStatsModel>;
|
|
@@ -36,11 +36,19 @@ export declare class RallyModel extends Model<RallyAttributes, RallyCreationAttr
|
|
|
36
36
|
match_set_id: string;
|
|
37
37
|
serving_team: string;
|
|
38
38
|
order: number;
|
|
39
|
+
RallyPositions: RallyPositionModel[];
|
|
40
|
+
Serves: ServeModel[];
|
|
41
|
+
Receptions: ReceptionModel[];
|
|
42
|
+
Sets: SetModel[];
|
|
43
|
+
Spikes: SpikeModel[];
|
|
44
|
+
Blocks: BlockModel[];
|
|
45
|
+
Substitutions: SubstitutionModel[];
|
|
46
|
+
LiberoReplacements: LiberoReplacementModel[];
|
|
47
|
+
Scores: ScoreModel[];
|
|
39
48
|
match_set: MatchSetModel;
|
|
40
49
|
getMatch_set: Sequelize.BelongsToGetAssociationMixin<MatchSetModel>;
|
|
41
50
|
setMatch_set: Sequelize.BelongsToSetAssociationMixin<MatchSetModel, MatchSetId>;
|
|
42
51
|
createMatch_set: Sequelize.BelongsToCreateAssociationMixin<MatchSetModel>;
|
|
43
|
-
Blocks: BlockModel[];
|
|
44
52
|
getBlocks: Sequelize.HasManyGetAssociationsMixin<BlockModel>;
|
|
45
53
|
setBlocks: Sequelize.HasManySetAssociationsMixin<BlockModel, BlockId>;
|
|
46
54
|
addBlock: Sequelize.HasManyAddAssociationMixin<BlockModel, BlockId>;
|
|
@@ -62,7 +70,6 @@ export declare class RallyModel extends Model<RallyAttributes, RallyCreationAttr
|
|
|
62
70
|
hasEvent: Sequelize.HasManyHasAssociationMixin<EventModel, EventId>;
|
|
63
71
|
hasEvents: Sequelize.HasManyHasAssociationsMixin<EventModel, EventId>;
|
|
64
72
|
countEvents: Sequelize.HasManyCountAssociationsMixin;
|
|
65
|
-
LiberoReplacements: LiberoReplacementModel[];
|
|
66
73
|
getLiberoReplacements: Sequelize.HasManyGetAssociationsMixin<LiberoReplacementModel>;
|
|
67
74
|
setLiberoReplacements: Sequelize.HasManySetAssociationsMixin<LiberoReplacementModel, LiberoReplacementId>;
|
|
68
75
|
addLiberoReplacement: Sequelize.HasManyAddAssociationMixin<LiberoReplacementModel, LiberoReplacementId>;
|
|
@@ -84,7 +91,6 @@ export declare class RallyModel extends Model<RallyAttributes, RallyCreationAttr
|
|
|
84
91
|
hasPlayer_id_Player_RallyPosition: Sequelize.BelongsToManyHasAssociationMixin<PlayerModel, PlayerId>;
|
|
85
92
|
hasPlayer_id_Player_RallyPositions: Sequelize.BelongsToManyHasAssociationsMixin<PlayerModel, PlayerId>;
|
|
86
93
|
countPlayer_id_Player_RallyPositions: Sequelize.BelongsToManyCountAssociationsMixin;
|
|
87
|
-
RallyPositions: RallyPositionModel[];
|
|
88
94
|
getRallyPositions: Sequelize.HasManyGetAssociationsMixin<RallyPositionModel>;
|
|
89
95
|
setRallyPositions: Sequelize.HasManySetAssociationsMixin<RallyPositionModel, RallyPositionId>;
|
|
90
96
|
addRallyPosition: Sequelize.HasManyAddAssociationMixin<RallyPositionModel, RallyPositionId>;
|
|
@@ -95,7 +101,6 @@ export declare class RallyModel extends Model<RallyAttributes, RallyCreationAttr
|
|
|
95
101
|
hasRallyPosition: Sequelize.HasManyHasAssociationMixin<RallyPositionModel, RallyPositionId>;
|
|
96
102
|
hasRallyPositions: Sequelize.HasManyHasAssociationsMixin<RallyPositionModel, RallyPositionId>;
|
|
97
103
|
countRallyPositions: Sequelize.HasManyCountAssociationsMixin;
|
|
98
|
-
Receptions: ReceptionModel[];
|
|
99
104
|
getReceptions: Sequelize.HasManyGetAssociationsMixin<ReceptionModel>;
|
|
100
105
|
setReceptions: Sequelize.HasManySetAssociationsMixin<ReceptionModel, ReceptionId>;
|
|
101
106
|
addReception: Sequelize.HasManyAddAssociationMixin<ReceptionModel, ReceptionId>;
|
|
@@ -106,7 +111,6 @@ export declare class RallyModel extends Model<RallyAttributes, RallyCreationAttr
|
|
|
106
111
|
hasReception: Sequelize.HasManyHasAssociationMixin<ReceptionModel, ReceptionId>;
|
|
107
112
|
hasReceptions: Sequelize.HasManyHasAssociationsMixin<ReceptionModel, ReceptionId>;
|
|
108
113
|
countReceptions: Sequelize.HasManyCountAssociationsMixin;
|
|
109
|
-
Scores: ScoreModel[];
|
|
110
114
|
getScores: Sequelize.HasManyGetAssociationsMixin<ScoreModel>;
|
|
111
115
|
setScores: Sequelize.HasManySetAssociationsMixin<ScoreModel, ScoreId>;
|
|
112
116
|
addScore: Sequelize.HasManyAddAssociationMixin<ScoreModel, ScoreId>;
|
|
@@ -117,7 +121,6 @@ export declare class RallyModel extends Model<RallyAttributes, RallyCreationAttr
|
|
|
117
121
|
hasScore: Sequelize.HasManyHasAssociationMixin<ScoreModel, ScoreId>;
|
|
118
122
|
hasScores: Sequelize.HasManyHasAssociationsMixin<ScoreModel, ScoreId>;
|
|
119
123
|
countScores: Sequelize.HasManyCountAssociationsMixin;
|
|
120
|
-
Serves: ServeModel[];
|
|
121
124
|
getServes: Sequelize.HasManyGetAssociationsMixin<ServeModel>;
|
|
122
125
|
setServes: Sequelize.HasManySetAssociationsMixin<ServeModel, ServeId>;
|
|
123
126
|
addSerf: Sequelize.HasManyAddAssociationMixin<ServeModel, ServeId>;
|
|
@@ -128,7 +131,6 @@ export declare class RallyModel extends Model<RallyAttributes, RallyCreationAttr
|
|
|
128
131
|
hasSerf: Sequelize.HasManyHasAssociationMixin<ServeModel, ServeId>;
|
|
129
132
|
hasServes: Sequelize.HasManyHasAssociationsMixin<ServeModel, ServeId>;
|
|
130
133
|
countServes: Sequelize.HasManyCountAssociationsMixin;
|
|
131
|
-
Sets: SetModel[];
|
|
132
134
|
getSets: Sequelize.HasManyGetAssociationsMixin<SetModel>;
|
|
133
135
|
setSets: Sequelize.HasManySetAssociationsMixin<SetModel, SetId>;
|
|
134
136
|
addSet: Sequelize.HasManyAddAssociationMixin<SetModel, SetId>;
|
|
@@ -139,7 +141,6 @@ export declare class RallyModel extends Model<RallyAttributes, RallyCreationAttr
|
|
|
139
141
|
hasSet: Sequelize.HasManyHasAssociationMixin<SetModel, SetId>;
|
|
140
142
|
hasSets: Sequelize.HasManyHasAssociationsMixin<SetModel, SetId>;
|
|
141
143
|
countSets: Sequelize.HasManyCountAssociationsMixin;
|
|
142
|
-
Spikes: SpikeModel[];
|
|
143
144
|
getSpikes: Sequelize.HasManyGetAssociationsMixin<SpikeModel>;
|
|
144
145
|
setSpikes: Sequelize.HasManySetAssociationsMixin<SpikeModel, SpikeId>;
|
|
145
146
|
addSpike: Sequelize.HasManyAddAssociationMixin<SpikeModel, SpikeId>;
|
|
@@ -150,7 +151,6 @@ export declare class RallyModel extends Model<RallyAttributes, RallyCreationAttr
|
|
|
150
151
|
hasSpike: Sequelize.HasManyHasAssociationMixin<SpikeModel, SpikeId>;
|
|
151
152
|
hasSpikes: Sequelize.HasManyHasAssociationsMixin<SpikeModel, SpikeId>;
|
|
152
153
|
countSpikes: Sequelize.HasManyCountAssociationsMixin;
|
|
153
|
-
Substitutions: SubstitutionModel[];
|
|
154
154
|
getSubstitutions: Sequelize.HasManyGetAssociationsMixin<SubstitutionModel>;
|
|
155
155
|
setSubstitutions: Sequelize.HasManySetAssociationsMixin<SubstitutionModel, SubstitutionId>;
|
|
156
156
|
addSubstitution: Sequelize.HasManyAddAssociationMixin<SubstitutionModel, SubstitutionId>;
|
|
@@ -20,11 +20,12 @@ export declare class SeasonModel extends Model<SeasonAttributes, SeasonCreationA
|
|
|
20
20
|
season_id: string;
|
|
21
21
|
iteration: number;
|
|
22
22
|
league_id: string;
|
|
23
|
+
seasonTeams: TeamModel[];
|
|
24
|
+
Matches: MatchModel[];
|
|
23
25
|
league: LeagueModel;
|
|
24
26
|
getLeague: Sequelize.BelongsToGetAssociationMixin<LeagueModel>;
|
|
25
27
|
setLeague: Sequelize.BelongsToSetAssociationMixin<LeagueModel, LeagueId>;
|
|
26
28
|
createLeague: Sequelize.BelongsToCreateAssociationMixin<LeagueModel>;
|
|
27
|
-
Matches: MatchModel[];
|
|
28
29
|
getMatches: Sequelize.HasManyGetAssociationsMixin<MatchModel>;
|
|
29
30
|
setMatches: Sequelize.HasManySetAssociationsMixin<MatchModel, MatchId>;
|
|
30
31
|
addMatch: Sequelize.HasManyAddAssociationMixin<MatchModel, MatchId>;
|
|
@@ -46,7 +47,6 @@ export declare class SeasonModel extends Model<SeasonAttributes, SeasonCreationA
|
|
|
46
47
|
hasSeasonTeam: Sequelize.HasManyHasAssociationMixin<SeasonTeamsModel, SeasonTeamsId>;
|
|
47
48
|
hasSeasonTeams: Sequelize.HasManyHasAssociationsMixin<SeasonTeamsModel, SeasonTeamsId>;
|
|
48
49
|
countSeasonTeams: Sequelize.HasManyCountAssociationsMixin;
|
|
49
|
-
seasonTeams: TeamModel[];
|
|
50
50
|
getseasonTeams: Sequelize.BelongsToManyGetAssociationsMixin<TeamModel>;
|
|
51
51
|
setseasonTeams: Sequelize.BelongsToManySetAssociationsMixin<TeamModel, TeamId>;
|
|
52
52
|
addTeam_id_Team: Sequelize.BelongsToManyAddAssociationMixin<TeamModel, TeamId>;
|
|
@@ -25,11 +25,12 @@ export type TeamCreationAttributes = TeamAttributes;
|
|
|
25
25
|
export declare class TeamModel extends Model<TeamAttributes, TeamCreationAttributes> implements TeamAttributes {
|
|
26
26
|
team_id: string;
|
|
27
27
|
coach_id: string;
|
|
28
|
+
league_id: string;
|
|
28
29
|
name: string;
|
|
29
30
|
short_name: string;
|
|
30
31
|
country_id: string;
|
|
31
|
-
league_id: string;
|
|
32
32
|
coach: CoachModel;
|
|
33
|
+
league: LeagueModel;
|
|
33
34
|
getCoach: Sequelize.BelongsToGetAssociationMixin<CoachModel>;
|
|
34
35
|
setCoach: Sequelize.BelongsToSetAssociationMixin<CoachModel, CoachId>;
|
|
35
36
|
createCoach: Sequelize.BelongsToCreateAssociationMixin<CoachModel>;
|
|
@@ -37,7 +38,6 @@ export declare class TeamModel extends Model<TeamAttributes, TeamCreationAttribu
|
|
|
37
38
|
getCountry: Sequelize.BelongsToGetAssociationMixin<CountryModel>;
|
|
38
39
|
setCountry: Sequelize.BelongsToSetAssociationMixin<CountryModel, CountryId>;
|
|
39
40
|
createCountry: Sequelize.BelongsToCreateAssociationMixin<CountryModel>;
|
|
40
|
-
league: LeagueModel;
|
|
41
41
|
getLeague: Sequelize.BelongsToGetAssociationMixin<LeagueModel>;
|
|
42
42
|
setLeague: Sequelize.BelongsToSetAssociationMixin<LeagueModel, LeagueId>;
|
|
43
43
|
createLeague: Sequelize.BelongsToCreateAssociationMixin<LeagueModel>;
|
|
@@ -14,8 +14,8 @@ export type TournamentStage = 'ROUND_OF_8' | 'QUARTERFINALS' | 'SEMIFINALS' | 'F
|
|
|
14
14
|
export type TournamentMatchCreationAttributes = TournamentMatchAttributes;
|
|
15
15
|
export declare class TournamentMatchModel extends Model<TournamentMatchAttributes, TournamentMatchCreationAttributes> implements TournamentMatchAttributes {
|
|
16
16
|
tournament_id: string;
|
|
17
|
-
index: number;
|
|
18
17
|
match_id: string;
|
|
18
|
+
index: number;
|
|
19
19
|
stage: TournamentStage;
|
|
20
20
|
tournament: TournamentModel;
|
|
21
21
|
getTournament: Sequelize.BelongsToGetAssociationMixin<TournamentModel>;
|
|
@@ -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)) {
|
|
@@ -50,8 +50,8 @@ export declare class MatchSet {
|
|
|
50
50
|
private readonly scoreThreshold;
|
|
51
51
|
private homeScore;
|
|
52
52
|
private awayScore;
|
|
53
|
-
constructor({ id, order, isTieBreak, homeLibero, awayLibero, stats, rallies, homeScore, awayScore }: MatchSetOpts);
|
|
54
53
|
private _state;
|
|
54
|
+
constructor({ id, order, isTieBreak, homeLibero, awayLibero, stats, rallies, homeScore, awayScore }: MatchSetOpts);
|
|
55
55
|
get state(): MatchSetState;
|
|
56
56
|
getHomeScore(): number;
|
|
57
57
|
getAwayScore(): number;
|
|
@@ -30,8 +30,8 @@ export declare class Rally {
|
|
|
30
30
|
readonly homePlayerPosition: PlayerPosition[];
|
|
31
31
|
readonly awayPlayerPosition: PlayerPosition[];
|
|
32
32
|
readonly order: number;
|
|
33
|
-
constructor({ id, order, servingTeam, homePlayerPosition, awayPlayerPosition, events }: RallyOpts);
|
|
34
33
|
private _state;
|
|
34
|
+
constructor({ id, order, servingTeam, homePlayerPosition, awayPlayerPosition, events }: RallyOpts);
|
|
35
35
|
get state(): RallyState;
|
|
36
36
|
get score(): Score | undefined;
|
|
37
37
|
isOver(): boolean;
|
|
@@ -7,6 +7,15 @@ class Tournament {
|
|
|
7
7
|
this.iteration = iteration;
|
|
8
8
|
this.matches = matches;
|
|
9
9
|
this.champion = champion;
|
|
10
|
+
this.matches.sort(Tournament.sortMatchesFn);
|
|
11
|
+
}
|
|
12
|
+
static sortMatchesFn(m1, m2) {
|
|
13
|
+
if (m1.stage > m2.stage)
|
|
14
|
+
return -1;
|
|
15
|
+
else if (m1.stage < m2.stage)
|
|
16
|
+
return 1;
|
|
17
|
+
else
|
|
18
|
+
return m1.index - m2.index;
|
|
10
19
|
}
|
|
11
20
|
}
|
|
12
21
|
exports.Tournament = Tournament;
|
|
@@ -18,11 +18,12 @@ export declare class LeagueModel extends Model<LeagueAttributes, LeagueCreationA
|
|
|
18
18
|
league_id: string;
|
|
19
19
|
country_id: string;
|
|
20
20
|
name: string;
|
|
21
|
+
Teams: TeamModel[];
|
|
22
|
+
Seasons: SeasonModel[];
|
|
21
23
|
country: CountryModel;
|
|
22
24
|
getCountry: Sequelize.BelongsToGetAssociationMixin<CountryModel>;
|
|
23
25
|
setCountry: Sequelize.BelongsToSetAssociationMixin<CountryModel, CountryId>;
|
|
24
26
|
createCountry: Sequelize.BelongsToCreateAssociationMixin<CountryModel>;
|
|
25
|
-
Seasons: SeasonModel[];
|
|
26
27
|
getSeasons: Sequelize.HasManyGetAssociationsMixin<SeasonModel>;
|
|
27
28
|
setSeasons: Sequelize.HasManySetAssociationsMixin<SeasonModel, SeasonId>;
|
|
28
29
|
addSeason: Sequelize.HasManyAddAssociationMixin<SeasonModel, SeasonId>;
|
|
@@ -33,7 +34,6 @@ export declare class LeagueModel extends Model<LeagueAttributes, LeagueCreationA
|
|
|
33
34
|
hasSeason: Sequelize.HasManyHasAssociationMixin<SeasonModel, SeasonId>;
|
|
34
35
|
hasSeasons: Sequelize.HasManyHasAssociationsMixin<SeasonModel, SeasonId>;
|
|
35
36
|
countSeasons: Sequelize.HasManyCountAssociationsMixin;
|
|
36
|
-
Teams: TeamModel[];
|
|
37
37
|
getTeams: Sequelize.HasManyGetAssociationsMixin<TeamModel>;
|
|
38
38
|
setTeams: Sequelize.HasManySetAssociationsMixin<TeamModel, TeamId>;
|
|
39
39
|
addTeam: Sequelize.HasManyAddAssociationMixin<TeamModel, TeamId>;
|
|
@@ -24,16 +24,17 @@ export declare class MatchSetModel extends Model<MatchSetAttributes, MatchSetCre
|
|
|
24
24
|
match_set_id: string;
|
|
25
25
|
match_id: string;
|
|
26
26
|
is_tie_break: boolean;
|
|
27
|
-
home_libero?: string;
|
|
28
|
-
away_libero?: string;
|
|
29
27
|
order: number;
|
|
30
28
|
home_score: number;
|
|
31
29
|
away_score: number;
|
|
30
|
+
home_libero?: string;
|
|
31
|
+
away_libero?: string;
|
|
32
|
+
Rallies: RallyModel[];
|
|
33
|
+
MatchSetStats: MatchSetStatsModel[];
|
|
32
34
|
match: MatchModel;
|
|
33
35
|
getMatch: Sequelize.BelongsToGetAssociationMixin<MatchModel>;
|
|
34
36
|
setMatch: Sequelize.BelongsToSetAssociationMixin<MatchModel, MatchId>;
|
|
35
37
|
createMatch: Sequelize.BelongsToCreateAssociationMixin<MatchModel>;
|
|
36
|
-
MatchSetStats: MatchSetStatsModel[];
|
|
37
38
|
getMatchSetStats: Sequelize.HasManyGetAssociationsMixin<MatchSetStatsModel>;
|
|
38
39
|
setMatchSetStats: Sequelize.HasManySetAssociationsMixin<MatchSetStatsModel, MatchSetStatsId>;
|
|
39
40
|
addMatchSetStat: Sequelize.HasManyAddAssociationMixin<MatchSetStatsModel, MatchSetStatsId>;
|
|
@@ -55,7 +56,6 @@ export declare class MatchSetModel extends Model<MatchSetAttributes, MatchSetCre
|
|
|
55
56
|
hasPlayer_id_Player: Sequelize.BelongsToManyHasAssociationMixin<PlayerModel, PlayerId>;
|
|
56
57
|
hasPlayer_id_Players: Sequelize.BelongsToManyHasAssociationsMixin<PlayerModel, PlayerId>;
|
|
57
58
|
countPlayer_id_Players: Sequelize.BelongsToManyCountAssociationsMixin;
|
|
58
|
-
Rallies: RallyModel[];
|
|
59
59
|
getRallies: Sequelize.HasManyGetAssociationsMixin<RallyModel>;
|
|
60
60
|
setRallies: Sequelize.HasManySetAssociationsMixin<RallyModel, RallyId>;
|
|
61
61
|
addRally: Sequelize.HasManyAddAssociationMixin<RallyModel, RallyId>;
|
|
@@ -42,6 +42,8 @@ export declare class PlayerModel extends Model<PlayerAttributes, PlayerCreationA
|
|
|
42
42
|
country_id: string;
|
|
43
43
|
team_id: string;
|
|
44
44
|
traits: TraitType[];
|
|
45
|
+
PerformanceStat: PerformanceStatsModel;
|
|
46
|
+
MatchSetStats: MatchSetStatsModel[];
|
|
45
47
|
country: CountryModel;
|
|
46
48
|
getCountry: Sequelize.BelongsToGetAssociationMixin<CountryModel>;
|
|
47
49
|
setCountry: Sequelize.BelongsToSetAssociationMixin<CountryModel, CountryId>;
|
|
@@ -156,7 +158,6 @@ export declare class PlayerModel extends Model<PlayerAttributes, PlayerCreationA
|
|
|
156
158
|
hasMatch_set_id_MatchSet: Sequelize.BelongsToManyHasAssociationMixin<MatchSetModel, MatchSetId>;
|
|
157
159
|
hasMatch_set_id_MatchSets: Sequelize.BelongsToManyHasAssociationsMixin<MatchSetModel, MatchSetId>;
|
|
158
160
|
countMatch_set_id_MatchSets: Sequelize.BelongsToManyCountAssociationsMixin;
|
|
159
|
-
MatchSetStats: MatchSetStatsModel[];
|
|
160
161
|
getMatchSetStats: Sequelize.HasManyGetAssociationsMixin<MatchSetStatsModel>;
|
|
161
162
|
setMatchSetStats: Sequelize.HasManySetAssociationsMixin<MatchSetStatsModel, MatchSetStatsId>;
|
|
162
163
|
addMatchSetStat: Sequelize.HasManyAddAssociationMixin<MatchSetStatsModel, MatchSetStatsId>;
|
|
@@ -167,7 +168,6 @@ export declare class PlayerModel extends Model<PlayerAttributes, PlayerCreationA
|
|
|
167
168
|
hasMatchSetStat: Sequelize.HasManyHasAssociationMixin<MatchSetStatsModel, MatchSetStatsId>;
|
|
168
169
|
hasMatchSetStats: Sequelize.HasManyHasAssociationsMixin<MatchSetStatsModel, MatchSetStatsId>;
|
|
169
170
|
countMatchSetStats: Sequelize.HasManyCountAssociationsMixin;
|
|
170
|
-
PerformanceStat: PerformanceStatsModel;
|
|
171
171
|
getPerformanceStat: Sequelize.HasOneGetAssociationMixin<PerformanceStatsModel>;
|
|
172
172
|
setPerformanceStat: Sequelize.HasOneSetAssociationMixin<PerformanceStatsModel, PerformanceStatsId>;
|
|
173
173
|
createPerformanceStat: Sequelize.HasOneCreateAssociationMixin<PerformanceStatsModel>;
|
|
@@ -36,11 +36,19 @@ export declare class RallyModel extends Model<RallyAttributes, RallyCreationAttr
|
|
|
36
36
|
match_set_id: string;
|
|
37
37
|
serving_team: string;
|
|
38
38
|
order: number;
|
|
39
|
+
RallyPositions: RallyPositionModel[];
|
|
40
|
+
Serves: ServeModel[];
|
|
41
|
+
Receptions: ReceptionModel[];
|
|
42
|
+
Sets: SetModel[];
|
|
43
|
+
Spikes: SpikeModel[];
|
|
44
|
+
Blocks: BlockModel[];
|
|
45
|
+
Substitutions: SubstitutionModel[];
|
|
46
|
+
LiberoReplacements: LiberoReplacementModel[];
|
|
47
|
+
Scores: ScoreModel[];
|
|
39
48
|
match_set: MatchSetModel;
|
|
40
49
|
getMatch_set: Sequelize.BelongsToGetAssociationMixin<MatchSetModel>;
|
|
41
50
|
setMatch_set: Sequelize.BelongsToSetAssociationMixin<MatchSetModel, MatchSetId>;
|
|
42
51
|
createMatch_set: Sequelize.BelongsToCreateAssociationMixin<MatchSetModel>;
|
|
43
|
-
Blocks: BlockModel[];
|
|
44
52
|
getBlocks: Sequelize.HasManyGetAssociationsMixin<BlockModel>;
|
|
45
53
|
setBlocks: Sequelize.HasManySetAssociationsMixin<BlockModel, BlockId>;
|
|
46
54
|
addBlock: Sequelize.HasManyAddAssociationMixin<BlockModel, BlockId>;
|
|
@@ -62,7 +70,6 @@ export declare class RallyModel extends Model<RallyAttributes, RallyCreationAttr
|
|
|
62
70
|
hasEvent: Sequelize.HasManyHasAssociationMixin<EventModel, EventId>;
|
|
63
71
|
hasEvents: Sequelize.HasManyHasAssociationsMixin<EventModel, EventId>;
|
|
64
72
|
countEvents: Sequelize.HasManyCountAssociationsMixin;
|
|
65
|
-
LiberoReplacements: LiberoReplacementModel[];
|
|
66
73
|
getLiberoReplacements: Sequelize.HasManyGetAssociationsMixin<LiberoReplacementModel>;
|
|
67
74
|
setLiberoReplacements: Sequelize.HasManySetAssociationsMixin<LiberoReplacementModel, LiberoReplacementId>;
|
|
68
75
|
addLiberoReplacement: Sequelize.HasManyAddAssociationMixin<LiberoReplacementModel, LiberoReplacementId>;
|
|
@@ -84,7 +91,6 @@ export declare class RallyModel extends Model<RallyAttributes, RallyCreationAttr
|
|
|
84
91
|
hasPlayer_id_Player_RallyPosition: Sequelize.BelongsToManyHasAssociationMixin<PlayerModel, PlayerId>;
|
|
85
92
|
hasPlayer_id_Player_RallyPositions: Sequelize.BelongsToManyHasAssociationsMixin<PlayerModel, PlayerId>;
|
|
86
93
|
countPlayer_id_Player_RallyPositions: Sequelize.BelongsToManyCountAssociationsMixin;
|
|
87
|
-
RallyPositions: RallyPositionModel[];
|
|
88
94
|
getRallyPositions: Sequelize.HasManyGetAssociationsMixin<RallyPositionModel>;
|
|
89
95
|
setRallyPositions: Sequelize.HasManySetAssociationsMixin<RallyPositionModel, RallyPositionId>;
|
|
90
96
|
addRallyPosition: Sequelize.HasManyAddAssociationMixin<RallyPositionModel, RallyPositionId>;
|
|
@@ -95,7 +101,6 @@ export declare class RallyModel extends Model<RallyAttributes, RallyCreationAttr
|
|
|
95
101
|
hasRallyPosition: Sequelize.HasManyHasAssociationMixin<RallyPositionModel, RallyPositionId>;
|
|
96
102
|
hasRallyPositions: Sequelize.HasManyHasAssociationsMixin<RallyPositionModel, RallyPositionId>;
|
|
97
103
|
countRallyPositions: Sequelize.HasManyCountAssociationsMixin;
|
|
98
|
-
Receptions: ReceptionModel[];
|
|
99
104
|
getReceptions: Sequelize.HasManyGetAssociationsMixin<ReceptionModel>;
|
|
100
105
|
setReceptions: Sequelize.HasManySetAssociationsMixin<ReceptionModel, ReceptionId>;
|
|
101
106
|
addReception: Sequelize.HasManyAddAssociationMixin<ReceptionModel, ReceptionId>;
|
|
@@ -106,7 +111,6 @@ export declare class RallyModel extends Model<RallyAttributes, RallyCreationAttr
|
|
|
106
111
|
hasReception: Sequelize.HasManyHasAssociationMixin<ReceptionModel, ReceptionId>;
|
|
107
112
|
hasReceptions: Sequelize.HasManyHasAssociationsMixin<ReceptionModel, ReceptionId>;
|
|
108
113
|
countReceptions: Sequelize.HasManyCountAssociationsMixin;
|
|
109
|
-
Scores: ScoreModel[];
|
|
110
114
|
getScores: Sequelize.HasManyGetAssociationsMixin<ScoreModel>;
|
|
111
115
|
setScores: Sequelize.HasManySetAssociationsMixin<ScoreModel, ScoreId>;
|
|
112
116
|
addScore: Sequelize.HasManyAddAssociationMixin<ScoreModel, ScoreId>;
|
|
@@ -117,7 +121,6 @@ export declare class RallyModel extends Model<RallyAttributes, RallyCreationAttr
|
|
|
117
121
|
hasScore: Sequelize.HasManyHasAssociationMixin<ScoreModel, ScoreId>;
|
|
118
122
|
hasScores: Sequelize.HasManyHasAssociationsMixin<ScoreModel, ScoreId>;
|
|
119
123
|
countScores: Sequelize.HasManyCountAssociationsMixin;
|
|
120
|
-
Serves: ServeModel[];
|
|
121
124
|
getServes: Sequelize.HasManyGetAssociationsMixin<ServeModel>;
|
|
122
125
|
setServes: Sequelize.HasManySetAssociationsMixin<ServeModel, ServeId>;
|
|
123
126
|
addSerf: Sequelize.HasManyAddAssociationMixin<ServeModel, ServeId>;
|
|
@@ -128,7 +131,6 @@ export declare class RallyModel extends Model<RallyAttributes, RallyCreationAttr
|
|
|
128
131
|
hasSerf: Sequelize.HasManyHasAssociationMixin<ServeModel, ServeId>;
|
|
129
132
|
hasServes: Sequelize.HasManyHasAssociationsMixin<ServeModel, ServeId>;
|
|
130
133
|
countServes: Sequelize.HasManyCountAssociationsMixin;
|
|
131
|
-
Sets: SetModel[];
|
|
132
134
|
getSets: Sequelize.HasManyGetAssociationsMixin<SetModel>;
|
|
133
135
|
setSets: Sequelize.HasManySetAssociationsMixin<SetModel, SetId>;
|
|
134
136
|
addSet: Sequelize.HasManyAddAssociationMixin<SetModel, SetId>;
|
|
@@ -139,7 +141,6 @@ export declare class RallyModel extends Model<RallyAttributes, RallyCreationAttr
|
|
|
139
141
|
hasSet: Sequelize.HasManyHasAssociationMixin<SetModel, SetId>;
|
|
140
142
|
hasSets: Sequelize.HasManyHasAssociationsMixin<SetModel, SetId>;
|
|
141
143
|
countSets: Sequelize.HasManyCountAssociationsMixin;
|
|
142
|
-
Spikes: SpikeModel[];
|
|
143
144
|
getSpikes: Sequelize.HasManyGetAssociationsMixin<SpikeModel>;
|
|
144
145
|
setSpikes: Sequelize.HasManySetAssociationsMixin<SpikeModel, SpikeId>;
|
|
145
146
|
addSpike: Sequelize.HasManyAddAssociationMixin<SpikeModel, SpikeId>;
|
|
@@ -150,7 +151,6 @@ export declare class RallyModel extends Model<RallyAttributes, RallyCreationAttr
|
|
|
150
151
|
hasSpike: Sequelize.HasManyHasAssociationMixin<SpikeModel, SpikeId>;
|
|
151
152
|
hasSpikes: Sequelize.HasManyHasAssociationsMixin<SpikeModel, SpikeId>;
|
|
152
153
|
countSpikes: Sequelize.HasManyCountAssociationsMixin;
|
|
153
|
-
Substitutions: SubstitutionModel[];
|
|
154
154
|
getSubstitutions: Sequelize.HasManyGetAssociationsMixin<SubstitutionModel>;
|
|
155
155
|
setSubstitutions: Sequelize.HasManySetAssociationsMixin<SubstitutionModel, SubstitutionId>;
|
|
156
156
|
addSubstitution: Sequelize.HasManyAddAssociationMixin<SubstitutionModel, SubstitutionId>;
|
|
@@ -20,11 +20,12 @@ export declare class SeasonModel extends Model<SeasonAttributes, SeasonCreationA
|
|
|
20
20
|
season_id: string;
|
|
21
21
|
iteration: number;
|
|
22
22
|
league_id: string;
|
|
23
|
+
seasonTeams: TeamModel[];
|
|
24
|
+
Matches: MatchModel[];
|
|
23
25
|
league: LeagueModel;
|
|
24
26
|
getLeague: Sequelize.BelongsToGetAssociationMixin<LeagueModel>;
|
|
25
27
|
setLeague: Sequelize.BelongsToSetAssociationMixin<LeagueModel, LeagueId>;
|
|
26
28
|
createLeague: Sequelize.BelongsToCreateAssociationMixin<LeagueModel>;
|
|
27
|
-
Matches: MatchModel[];
|
|
28
29
|
getMatches: Sequelize.HasManyGetAssociationsMixin<MatchModel>;
|
|
29
30
|
setMatches: Sequelize.HasManySetAssociationsMixin<MatchModel, MatchId>;
|
|
30
31
|
addMatch: Sequelize.HasManyAddAssociationMixin<MatchModel, MatchId>;
|
|
@@ -46,7 +47,6 @@ export declare class SeasonModel extends Model<SeasonAttributes, SeasonCreationA
|
|
|
46
47
|
hasSeasonTeam: Sequelize.HasManyHasAssociationMixin<SeasonTeamsModel, SeasonTeamsId>;
|
|
47
48
|
hasSeasonTeams: Sequelize.HasManyHasAssociationsMixin<SeasonTeamsModel, SeasonTeamsId>;
|
|
48
49
|
countSeasonTeams: Sequelize.HasManyCountAssociationsMixin;
|
|
49
|
-
seasonTeams: TeamModel[];
|
|
50
50
|
getseasonTeams: Sequelize.BelongsToManyGetAssociationsMixin<TeamModel>;
|
|
51
51
|
setseasonTeams: Sequelize.BelongsToManySetAssociationsMixin<TeamModel, TeamId>;
|
|
52
52
|
addTeam_id_Team: Sequelize.BelongsToManyAddAssociationMixin<TeamModel, TeamId>;
|
|
@@ -25,11 +25,12 @@ export type TeamCreationAttributes = TeamAttributes;
|
|
|
25
25
|
export declare class TeamModel extends Model<TeamAttributes, TeamCreationAttributes> implements TeamAttributes {
|
|
26
26
|
team_id: string;
|
|
27
27
|
coach_id: string;
|
|
28
|
+
league_id: string;
|
|
28
29
|
name: string;
|
|
29
30
|
short_name: string;
|
|
30
31
|
country_id: string;
|
|
31
|
-
league_id: string;
|
|
32
32
|
coach: CoachModel;
|
|
33
|
+
league: LeagueModel;
|
|
33
34
|
getCoach: Sequelize.BelongsToGetAssociationMixin<CoachModel>;
|
|
34
35
|
setCoach: Sequelize.BelongsToSetAssociationMixin<CoachModel, CoachId>;
|
|
35
36
|
createCoach: Sequelize.BelongsToCreateAssociationMixin<CoachModel>;
|
|
@@ -37,7 +38,6 @@ export declare class TeamModel extends Model<TeamAttributes, TeamCreationAttribu
|
|
|
37
38
|
getCountry: Sequelize.BelongsToGetAssociationMixin<CountryModel>;
|
|
38
39
|
setCountry: Sequelize.BelongsToSetAssociationMixin<CountryModel, CountryId>;
|
|
39
40
|
createCountry: Sequelize.BelongsToCreateAssociationMixin<CountryModel>;
|
|
40
|
-
league: LeagueModel;
|
|
41
41
|
getLeague: Sequelize.BelongsToGetAssociationMixin<LeagueModel>;
|
|
42
42
|
setLeague: Sequelize.BelongsToSetAssociationMixin<LeagueModel, LeagueId>;
|
|
43
43
|
createLeague: Sequelize.BelongsToCreateAssociationMixin<LeagueModel>;
|
|
@@ -14,8 +14,8 @@ export type TournamentStage = 'ROUND_OF_8' | 'QUARTERFINALS' | 'SEMIFINALS' | 'F
|
|
|
14
14
|
export type TournamentMatchCreationAttributes = TournamentMatchAttributes;
|
|
15
15
|
export declare class TournamentMatchModel extends Model<TournamentMatchAttributes, TournamentMatchCreationAttributes> implements TournamentMatchAttributes {
|
|
16
16
|
tournament_id: string;
|
|
17
|
-
index: number;
|
|
18
17
|
match_id: string;
|
|
18
|
+
index: number;
|
|
19
19
|
stage: TournamentStage;
|
|
20
20
|
tournament: TournamentModel;
|
|
21
21
|
getTournament: Sequelize.BelongsToGetAssociationMixin<TournamentModel>;
|
|
@@ -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)) {
|
|
@@ -50,8 +50,8 @@ export declare class MatchSet {
|
|
|
50
50
|
private readonly scoreThreshold;
|
|
51
51
|
private homeScore;
|
|
52
52
|
private awayScore;
|
|
53
|
-
constructor({ id, order, isTieBreak, homeLibero, awayLibero, stats, rallies, homeScore, awayScore }: MatchSetOpts);
|
|
54
53
|
private _state;
|
|
54
|
+
constructor({ id, order, isTieBreak, homeLibero, awayLibero, stats, rallies, homeScore, awayScore }: MatchSetOpts);
|
|
55
55
|
get state(): MatchSetState;
|
|
56
56
|
getHomeScore(): number;
|
|
57
57
|
getAwayScore(): number;
|
|
@@ -30,8 +30,8 @@ export declare class Rally {
|
|
|
30
30
|
readonly homePlayerPosition: PlayerPosition[];
|
|
31
31
|
readonly awayPlayerPosition: PlayerPosition[];
|
|
32
32
|
readonly order: number;
|
|
33
|
-
constructor({ id, order, servingTeam, homePlayerPosition, awayPlayerPosition, events }: RallyOpts);
|
|
34
33
|
private _state;
|
|
34
|
+
constructor({ id, order, servingTeam, homePlayerPosition, awayPlayerPosition, events }: RallyOpts);
|
|
35
35
|
get state(): RallyState;
|
|
36
36
|
get score(): Score | undefined;
|
|
37
37
|
isOver(): boolean;
|
|
@@ -4,5 +4,14 @@ export class Tournament {
|
|
|
4
4
|
this.iteration = iteration;
|
|
5
5
|
this.matches = matches;
|
|
6
6
|
this.champion = champion;
|
|
7
|
+
this.matches.sort(Tournament.sortMatchesFn);
|
|
8
|
+
}
|
|
9
|
+
static sortMatchesFn(m1, m2) {
|
|
10
|
+
if (m1.stage > m2.stage)
|
|
11
|
+
return -1;
|
|
12
|
+
else if (m1.stage < m2.stage)
|
|
13
|
+
return 1;
|
|
14
|
+
else
|
|
15
|
+
return m1.index - m2.index;
|
|
7
16
|
}
|
|
8
17
|
}
|