@mtgame/core 0.1.37 → 0.1.38

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.
Files changed (58) hide show
  1. package/api/public-api.d.ts +10 -9
  2. package/api/rugby-game-api.d.ts +16 -0
  3. package/api/tournament-api.d.ts +2 -0
  4. package/bundles/mtgame-core.umd.js +669 -157
  5. package/bundles/mtgame-core.umd.js.map +1 -1
  6. package/bundles/mtgame-core.umd.min.js +1 -1
  7. package/bundles/mtgame-core.umd.min.js.map +1 -1
  8. package/esm2015/api/public-api.js +10 -9
  9. package/esm2015/api/rugby-game-api.js +50 -0
  10. package/esm2015/api/tournament-api.js +12 -1
  11. package/esm2015/localization/public-api.js +2 -1
  12. package/esm2015/localization/rugby-game-log-types.js +36 -0
  13. package/esm2015/localization/user-profile.js +10 -1
  14. package/esm2015/models/public-api.js +7 -1
  15. package/esm2015/models/rugby-game-config.js +34 -0
  16. package/esm2015/models/rugby-game-log.js +124 -0
  17. package/esm2015/models/rugby-game-statistic.js +51 -0
  18. package/esm2015/models/rugby-game-team-statistic.js +27 -0
  19. package/esm2015/models/rugby-profile.js +37 -0
  20. package/esm2015/models/rugby-statistic.js +84 -0
  21. package/esm2015/models/sport.js +13 -1
  22. package/esm2015/models/tournament.js +4 -2
  23. package/esm2015/models/user.js +4 -1
  24. package/esm5/api/public-api.js +10 -9
  25. package/esm5/api/rugby-game-api.js +61 -0
  26. package/esm5/api/tournament-api.js +15 -1
  27. package/esm5/localization/public-api.js +2 -1
  28. package/esm5/localization/rugby-game-log-types.js +37 -0
  29. package/esm5/localization/user-profile.js +11 -2
  30. package/esm5/models/public-api.js +7 -1
  31. package/esm5/models/rugby-game-config.js +39 -0
  32. package/esm5/models/rugby-game-log.js +132 -0
  33. package/esm5/models/rugby-game-statistic.js +64 -0
  34. package/esm5/models/rugby-game-team-statistic.js +32 -0
  35. package/esm5/models/rugby-profile.js +42 -0
  36. package/esm5/models/rugby-statistic.js +93 -0
  37. package/esm5/models/sport.js +13 -1
  38. package/esm5/models/tournament.js +4 -2
  39. package/esm5/models/user.js +4 -1
  40. package/fesm2015/mtgame-core.js +439 -2
  41. package/fesm2015/mtgame-core.js.map +1 -1
  42. package/fesm5/mtgame-core.js +655 -158
  43. package/fesm5/mtgame-core.js.map +1 -1
  44. package/localization/public-api.d.ts +1 -0
  45. package/localization/rugby-game-log-types.d.ts +35 -0
  46. package/localization/user-profile.d.ts +9 -0
  47. package/models/public-api.d.ts +6 -0
  48. package/models/rugby-game-config.d.ts +15 -0
  49. package/models/rugby-game-log.d.ts +71 -0
  50. package/models/rugby-game-statistic.d.ts +29 -0
  51. package/models/rugby-game-team-statistic.d.ts +8 -0
  52. package/models/rugby-profile.d.ts +16 -0
  53. package/models/rugby-statistic.d.ts +52 -0
  54. package/models/sport.d.ts +7 -1
  55. package/models/tournament.d.ts +2 -0
  56. package/models/user.d.ts +2 -0
  57. package/mtgame-core.metadata.json +1 -1
  58. package/package.json +1 -1
@@ -357,6 +357,9 @@ var SportTypes;
357
357
  SportTypes[SportTypes["mini_football"] = 12] = "mini_football";
358
358
  SportTypes[SportTypes["handball"] = 13] = "handball";
359
359
  SportTypes[SportTypes["handball_classic"] = 14] = "handball_classic";
360
+ SportTypes[SportTypes["rugby"] = 15] = "rugby";
361
+ SportTypes[SportTypes["rugby7"] = 16] = "rugby7";
362
+ SportTypes[SportTypes["rugby15"] = 17] = "rugby15";
360
363
  })(SportTypes || (SportTypes = {}));
361
364
  let Sport = class Sport extends BaseModel {
362
365
  isBasketball() {
@@ -401,6 +404,15 @@ let Sport = class Sport extends BaseModel {
401
404
  isHandballClassic() {
402
405
  return this.id === SportTypes.handball_classic;
403
406
  }
407
+ isRugby() {
408
+ return this.id === SportTypes.rugby || this.parentId === SportTypes.rugby;
409
+ }
410
+ isRugby15() {
411
+ return this.id === SportTypes.rugby15;
412
+ }
413
+ isRugby7() {
414
+ return this.id === SportTypes.rugby7;
415
+ }
404
416
  static toFront(data) {
405
417
  return null;
406
418
  }
@@ -658,6 +670,40 @@ HandballProfile = __decorate([
658
670
  })
659
671
  ], HandballProfile);
660
672
 
673
+ var GameRugbyPosition;
674
+ (function (GameRugbyPosition) {
675
+ GameRugbyPosition[GameRugbyPosition["front_line"] = 1] = "front_line";
676
+ GameRugbyPosition[GameRugbyPosition["second_line"] = 2] = "second_line";
677
+ GameRugbyPosition[GameRugbyPosition["back_line"] = 3] = "back_line";
678
+ GameRugbyPosition[GameRugbyPosition["halfback"] = 4] = "halfback";
679
+ GameRugbyPosition[GameRugbyPosition["three_quarter"] = 5] = "three_quarter";
680
+ GameRugbyPosition[GameRugbyPosition["fullback"] = 6] = "fullback";
681
+ })(GameRugbyPosition || (GameRugbyPosition = {}));
682
+ let RugbyProfile = class RugbyProfile extends BaseModel {
683
+ static toFront(value) {
684
+ }
685
+ static toBack(value) {
686
+ }
687
+ };
688
+ __decorate([
689
+ ToFrontHook
690
+ ], RugbyProfile, "toFront", null);
691
+ __decorate([
692
+ ToBackHook
693
+ ], RugbyProfile, "toBack", null);
694
+ RugbyProfile = __decorate([
695
+ ModelInstance({
696
+ mappingFields: {
697
+ id: 'id',
698
+ user_id: 'userId',
699
+ position: 'position'
700
+ },
701
+ relation: {
702
+ position: enumField(GameRugbyPosition),
703
+ }
704
+ })
705
+ ], RugbyProfile);
706
+
661
707
  var UserGender;
662
708
  (function (UserGender) {
663
709
  UserGender[UserGender["male"] = 1] = "male";
@@ -710,6 +756,7 @@ User = __decorate([
710
756
  hockey_profile: 'hockeyProfile',
711
757
  football_profile: 'footballProfile',
712
758
  handball_profile: 'handballProfile',
759
+ rugby_profile: 'rugbyProfile',
713
760
  wizards: 'wizards',
714
761
  city: 'city',
715
762
  gender: 'gender',
@@ -724,6 +771,7 @@ User = __decorate([
724
771
  hockeyProfile: HockeyProfile,
725
772
  footballProfile: FootballProfile,
726
773
  handballProfile: HandballProfile,
774
+ rugbyProfile: RugbyProfile,
727
775
  city: City,
728
776
  gender: enumField(UserGender)
729
777
  }
@@ -997,7 +1045,9 @@ TournamentSettings = __decorate([
997
1045
  volleyball_statistic_type: 'volleyballStatisticType',
998
1046
  shot_clock_enabled: 'shotClockEnabled',
999
1047
  game_time_type: 'gameTimeType',
1000
- with_result_table: 'withResultTable'
1048
+ with_result_table: 'withResultTable',
1049
+ free_substitute_enabled: 'freeSubstituteEnabled',
1050
+ bonus_points_enabled: 'bonusPointsEnabled',
1001
1051
  },
1002
1052
  relation: {
1003
1053
  type: enumField(TournamentTypes),
@@ -4100,6 +4150,82 @@ LeagueUser = __decorate([
4100
4150
  })
4101
4151
  ], LeagueUser);
4102
4152
 
4153
+ let RugbyStatistic = class RugbyStatistic extends BaseModel {
4154
+ get userMinutes() {
4155
+ if (!this.gameTime) {
4156
+ return '00:00';
4157
+ }
4158
+ const minutes = Math.floor(this.gameTime / 60);
4159
+ const seconds = Math.floor(this.gameTime - minutes * 60);
4160
+ return `${minutes < 10 ? 0 : ''}${minutes}:${seconds < 10 ? 0 : ''}${seconds}`;
4161
+ }
4162
+ static toFront(data) { }
4163
+ static toBack(data) { }
4164
+ };
4165
+ __decorate([
4166
+ ToFrontHook
4167
+ ], RugbyStatistic, "toFront", null);
4168
+ __decorate([
4169
+ ToBackHook
4170
+ ], RugbyStatistic, "toBack", null);
4171
+ RugbyStatistic = __decorate([
4172
+ ModelInstance({
4173
+ mappingFields: {
4174
+ tournament_team_user: 'tournamentTeamUser',
4175
+ team: 'team',
4176
+ team_user: 'teamUser',
4177
+ user: 'user',
4178
+ tournament_team: 'tournamentTeam',
4179
+ month: 'month',
4180
+ win_lose: 'winLose',
4181
+ games_count: 'gamesCount',
4182
+ won_games_count: 'wonGamesCount',
4183
+ newbie: 'newbie',
4184
+ // User statistic
4185
+ points: 'points',
4186
+ tries: 'tries',
4187
+ penalty_tries: 'penaltyTries',
4188
+ conversion_goals: 'conversionGoals',
4189
+ conversion_misses: 'conversionMisses',
4190
+ drawing_ball: 'drawingBall',
4191
+ penalty_misses: 'penaltyMisses',
4192
+ penalty_goals: 'penaltyGoals',
4193
+ drop_goals: 'dropGoals',
4194
+ drop_goal_misses: 'dropGoalMisses',
4195
+ free_kicks: 'freeKicks',
4196
+ yellow_cards: 'yellowCards',
4197
+ red_cards: 'redCards',
4198
+ offloads: 'offloads',
4199
+ tackles: 'tackles',
4200
+ outs: 'outs',
4201
+ handling_errors: 'handlingErrors',
4202
+ carries_other_gainline: 'carriesOtherGainline',
4203
+ plus_minus: 'plusMinus',
4204
+ game_time: 'gameTime',
4205
+ // Team statistic
4206
+ scrums_won: 'scrumsWon',
4207
+ scrum_losses: 'scrumLosses',
4208
+ scrums_won_free: 'scrumsWonFree',
4209
+ lineouts_success: 'lineoutsSuccess',
4210
+ lineouts_steal: 'lineoutsSteal',
4211
+ quick_throws: 'quickThrows',
4212
+ rucks_won: 'rucksWon',
4213
+ ruck_losses: 'ruckLosses',
4214
+ mauls_won: 'maulsWon',
4215
+ maul_losses: 'maulLosses',
4216
+ fouls: 'fouls'
4217
+ },
4218
+ relation: {
4219
+ tournamentTeamUser: TournamentTeamUser,
4220
+ team: Team,
4221
+ teamUser: TeamUser,
4222
+ user: User,
4223
+ tournamentTeam: TournamentTeam,
4224
+ month: DateField
4225
+ }
4226
+ })
4227
+ ], RugbyStatistic);
4228
+
4103
4229
  let TournamentApi = class TournamentApi {
4104
4230
  constructor(httpClient, configService) {
4105
4231
  this.httpClient = httpClient;
@@ -4334,6 +4460,16 @@ let TournamentApi = class TournamentApi {
4334
4460
  }))).toPromise();
4335
4461
  });
4336
4462
  }
4463
+ getRugbyStatistic(filters) {
4464
+ return __awaiter(this, void 0, void 0, function* () {
4465
+ let params = new HttpParams();
4466
+ params = applyStatisticFilters(filters, params);
4467
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/rugby_statistic/`, { params, observe: 'response' }).pipe(map(result => ({
4468
+ total: +result.headers.get('X-Page-Count'),
4469
+ data: RugbyStatistic.toFront(result.body)
4470
+ }))).toPromise();
4471
+ });
4472
+ }
4337
4473
  getTournamentTeamUsers(tournamentTeamId) {
4338
4474
  return __awaiter(this, void 0, void 0, function* () {
4339
4475
  return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_team/${tournamentTeamId}/users/`).pipe(map(result => TournamentTeamUser.toFront(result))).toPromise();
@@ -5439,6 +5575,234 @@ ReferenceApi = __decorate([
5439
5575
  Injectable({ providedIn: 'root' })
5440
5576
  ], ReferenceApi);
5441
5577
 
5578
+ let RugbyGameTeamStatistic = class RugbyGameTeamStatistic extends BaseModel {
5579
+ static toFront(data) { }
5580
+ static toBack(data) { }
5581
+ };
5582
+ __decorate([
5583
+ ToFrontHook
5584
+ ], RugbyGameTeamStatistic, "toFront", null);
5585
+ __decorate([
5586
+ ToBackHook
5587
+ ], RugbyGameTeamStatistic, "toBack", null);
5588
+ RugbyGameTeamStatistic = __decorate([
5589
+ ModelInstance({
5590
+ mappingFields: {
5591
+ team: 'team',
5592
+ competitor_team: 'competitorTeam'
5593
+ },
5594
+ relation: {
5595
+ team: RugbyStatistic,
5596
+ competitorTeam: RugbyStatistic
5597
+ }
5598
+ })
5599
+ ], RugbyGameTeamStatistic);
5600
+
5601
+ let RugbyGameStatistic = class RugbyGameStatistic extends BaseModel {
5602
+ get id() {
5603
+ return this.gameUserId;
5604
+ }
5605
+ get gameMinutes() {
5606
+ return Math.floor(this.gameTime / 60);
5607
+ }
5608
+ static toFront(data) { }
5609
+ static toBack(data) { }
5610
+ };
5611
+ __decorate([
5612
+ ToFrontHook
5613
+ ], RugbyGameStatistic, "toFront", null);
5614
+ __decorate([
5615
+ ToBackHook
5616
+ ], RugbyGameStatistic, "toBack", null);
5617
+ RugbyGameStatistic = __decorate([
5618
+ ModelInstance({
5619
+ mappingFields: {
5620
+ game_user_id: 'gameUserId',
5621
+ updated_at: 'updatedAt',
5622
+ points: 'points',
5623
+ tries: 'tries',
5624
+ penalty_tries: 'penaltyTries',
5625
+ conversion_goals: 'conversionGoals',
5626
+ conversion_misses: 'conversionMisses',
5627
+ drawing_ball: 'drawingBall',
5628
+ penalty_misses: 'penaltyMisses',
5629
+ penalty_goals: 'penaltyGoals',
5630
+ drop_goals: 'dropGoals',
5631
+ drop_goal_misses: 'dropGoalMisses',
5632
+ free_kicks: 'freeKicks',
5633
+ yellow_cards: 'yellowCards',
5634
+ red_cards: 'redCards',
5635
+ offloads: 'offloads',
5636
+ tackles: 'tackles',
5637
+ outs: 'outs',
5638
+ handling_errors: 'handlingErrors',
5639
+ carries_other_gainline: 'carriesOtherGainline',
5640
+ game_time: 'gameTime',
5641
+ plus_minus: 'plusMinus'
5642
+ },
5643
+ relation: {
5644
+ updatedAt: DateTimeField,
5645
+ }
5646
+ })
5647
+ ], RugbyGameStatistic);
5648
+
5649
+ var RugbyGameLogTypes;
5650
+ (function (RugbyGameLogTypes) {
5651
+ RugbyGameLogTypes[RugbyGameLogTypes["enter_game"] = 1] = "enter_game";
5652
+ RugbyGameLogTypes[RugbyGameLogTypes["exit_game"] = 2] = "exit_game";
5653
+ RugbyGameLogTypes[RugbyGameLogTypes["try"] = 3] = "try";
5654
+ RugbyGameLogTypes[RugbyGameLogTypes["penalty_try"] = 4] = "penalty_try";
5655
+ RugbyGameLogTypes[RugbyGameLogTypes["conversion_goal"] = 5] = "conversion_goal";
5656
+ RugbyGameLogTypes[RugbyGameLogTypes["conversion_miss"] = 6] = "conversion_miss";
5657
+ RugbyGameLogTypes[RugbyGameLogTypes["drawing_ball"] = 7] = "drawing_ball";
5658
+ RugbyGameLogTypes[RugbyGameLogTypes["penalty_miss"] = 8] = "penalty_miss";
5659
+ RugbyGameLogTypes[RugbyGameLogTypes["penalty_goal"] = 9] = "penalty_goal";
5660
+ RugbyGameLogTypes[RugbyGameLogTypes["drop_goal"] = 10] = "drop_goal";
5661
+ RugbyGameLogTypes[RugbyGameLogTypes["drop_goal_miss"] = 11] = "drop_goal_miss";
5662
+ RugbyGameLogTypes[RugbyGameLogTypes["free_kick"] = 12] = "free_kick";
5663
+ RugbyGameLogTypes[RugbyGameLogTypes["yellow_card"] = 13] = "yellow_card";
5664
+ RugbyGameLogTypes[RugbyGameLogTypes["red_card"] = 14] = "red_card";
5665
+ RugbyGameLogTypes[RugbyGameLogTypes["offload"] = 15] = "offload";
5666
+ RugbyGameLogTypes[RugbyGameLogTypes["tackle"] = 16] = "tackle";
5667
+ RugbyGameLogTypes[RugbyGameLogTypes["out"] = 17] = "out";
5668
+ RugbyGameLogTypes[RugbyGameLogTypes["handling_error"] = 18] = "handling_error";
5669
+ RugbyGameLogTypes[RugbyGameLogTypes["carries_other_gainline"] = 19] = "carries_other_gainline";
5670
+ // team actions
5671
+ RugbyGameLogTypes[RugbyGameLogTypes["timeout"] = 20] = "timeout";
5672
+ RugbyGameLogTypes[RugbyGameLogTypes["scrum_won"] = 21] = "scrum_won";
5673
+ RugbyGameLogTypes[RugbyGameLogTypes["scrum_lose"] = 22] = "scrum_lose";
5674
+ RugbyGameLogTypes[RugbyGameLogTypes["scrum_won_free"] = 23] = "scrum_won_free";
5675
+ RugbyGameLogTypes[RugbyGameLogTypes["lineout_success"] = 24] = "lineout_success";
5676
+ RugbyGameLogTypes[RugbyGameLogTypes["lineout_loss"] = 25] = "lineout_loss";
5677
+ RugbyGameLogTypes[RugbyGameLogTypes["lineout_steal"] = 26] = "lineout_steal";
5678
+ RugbyGameLogTypes[RugbyGameLogTypes["quick_throw"] = 27] = "quick_throw";
5679
+ RugbyGameLogTypes[RugbyGameLogTypes["ruck_won"] = 28] = "ruck_won";
5680
+ RugbyGameLogTypes[RugbyGameLogTypes["ruck_lose"] = 29] = "ruck_lose";
5681
+ RugbyGameLogTypes[RugbyGameLogTypes["maul_won"] = 30] = "maul_won";
5682
+ RugbyGameLogTypes[RugbyGameLogTypes["maul_lose"] = 31] = "maul_lose";
5683
+ RugbyGameLogTypes[RugbyGameLogTypes["team_foul"] = 32] = "team_foul";
5684
+ })(RugbyGameLogTypes || (RugbyGameLogTypes = {}));
5685
+ const RUGBY_GAME_LOG_TYPE_POINTS = {
5686
+ [RugbyGameLogTypes.penalty_try]: 7,
5687
+ [RugbyGameLogTypes.try]: 5,
5688
+ [RugbyGameLogTypes.conversion_goal]: 2,
5689
+ [RugbyGameLogTypes.penalty_goal]: 3,
5690
+ [RugbyGameLogTypes.drop_goal]: 3
5691
+ };
5692
+ const RUGBY_TEAM_LOG_TYPES = [
5693
+ RugbyGameLogTypes.timeout, RugbyGameLogTypes.scrum_won, RugbyGameLogTypes.scrum_lose, RugbyGameLogTypes.scrum_won_free,
5694
+ RugbyGameLogTypes.lineout_success, RugbyGameLogTypes.lineout_loss, RugbyGameLogTypes.lineout_steal, RugbyGameLogTypes.quick_throw,
5695
+ RugbyGameLogTypes.ruck_won, RugbyGameLogTypes.ruck_lose, RugbyGameLogTypes.maul_won, RugbyGameLogTypes.maul_lose,
5696
+ RugbyGameLogTypes.team_foul,
5697
+ ];
5698
+ let RugbyGameLog = class RugbyGameLog extends BaseModel {
5699
+ constructor() {
5700
+ super(...arguments);
5701
+ this.active = true;
5702
+ }
5703
+ compare(model) {
5704
+ if (this.time === model.time && this.period === model.period) {
5705
+ return this.datetime.getTime() < model.datetime.getTime() ? 1 : -1;
5706
+ }
5707
+ if (this.period === model.period) {
5708
+ return this.time < model.time ? 1 : -1;
5709
+ }
5710
+ return this.period < model.period ? 1 : -1;
5711
+ }
5712
+ get timeFormatted() {
5713
+ const minutes = Math.floor(this.time / 60);
5714
+ const seconds = this.time - minutes * 60;
5715
+ return `${minutes < 10 ? '0' : ''}${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
5716
+ }
5717
+ isScoreType() {
5718
+ return RUGBY_GAME_LOG_TYPE_POINTS[this.logType] !== undefined;
5719
+ }
5720
+ scorePoints() {
5721
+ return RUGBY_GAME_LOG_TYPE_POINTS[this.logType];
5722
+ }
5723
+ isAfter(log) {
5724
+ if (this.time === log.time && this.period === log.period) {
5725
+ return this.id > log.id;
5726
+ }
5727
+ if (this.period === log.period) {
5728
+ return this.time > log.time;
5729
+ }
5730
+ return this.period > log.period;
5731
+ }
5732
+ isFoulType() {
5733
+ return [RugbyGameLogTypes.team_foul, RugbyGameLogTypes.yellow_card, RugbyGameLogTypes.red_card].indexOf(this.logType) > -1;
5734
+ }
5735
+ isTeamType() {
5736
+ return RUGBY_TEAM_LOG_TYPES.includes(this.logType);
5737
+ }
5738
+ static toFront(value) { }
5739
+ static toBack(value) { }
5740
+ };
5741
+ __decorate([
5742
+ ToFrontHook
5743
+ ], RugbyGameLog, "toFront", null);
5744
+ __decorate([
5745
+ ToBackHook
5746
+ ], RugbyGameLog, "toBack", null);
5747
+ RugbyGameLog = __decorate([
5748
+ ModelInstance({
5749
+ mappingFields: {
5750
+ id: 'id',
5751
+ unique_id: 'uniqueId',
5752
+ game_id: 'gameId',
5753
+ game_user_id: 'gameUserId',
5754
+ team_id: 'teamId',
5755
+ log_type: 'logType',
5756
+ datetime: 'datetime',
5757
+ time: 'time',
5758
+ period: 'period',
5759
+ active: 'active',
5760
+ is_highlight: 'isHighlight',
5761
+ penalty_type: 'penaltyType',
5762
+ },
5763
+ relation: {
5764
+ datetime: DateTimeField,
5765
+ logType: enumField(RugbyGameLogTypes)
5766
+ }
5767
+ })
5768
+ ], RugbyGameLog);
5769
+
5770
+ let RugbyGameApi = class RugbyGameApi extends GameBaseApi {
5771
+ constructor(httpClient, configService) {
5772
+ super(httpClient, configService);
5773
+ this.httpClient = httpClient;
5774
+ this.configService = configService;
5775
+ }
5776
+ getById(gameId) {
5777
+ return __awaiter(this, void 0, void 0, function* () {
5778
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_rugby_game/${gameId}/`).pipe(map(result => Game.toFront(result))).toPromise();
5779
+ });
5780
+ }
5781
+ getTeamStatistic(gameId) {
5782
+ return __awaiter(this, void 0, void 0, function* () {
5783
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_rugby_game/${gameId}/team_statistic/`).pipe(map(result => RugbyGameTeamStatistic.toFront(result))).toPromise();
5784
+ });
5785
+ }
5786
+ getUserStatistic(gameId) {
5787
+ return __awaiter(this, void 0, void 0, function* () {
5788
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_rugby_game/${gameId}/user_statistic/`).pipe(map(result => RugbyGameStatistic.toFront(result))).toPromise();
5789
+ });
5790
+ }
5791
+ getLogs(gameId) {
5792
+ return __awaiter(this, void 0, void 0, function* () {
5793
+ return this.httpClient.get(`${this.configService.get('apiUrl')}/api/v1/tournament_rugby_game/${gameId}/logs/`).pipe(map(result => RugbyGameLog.toFront(result))).toPromise();
5794
+ });
5795
+ }
5796
+ };
5797
+ RugbyGameApi.ctorParameters = () => [
5798
+ { type: HttpClient },
5799
+ { type: ConfigService }
5800
+ ];
5801
+ RugbyGameApi.ɵprov = ɵɵdefineInjectable({ factory: function RugbyGameApi_Factory() { return new RugbyGameApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: RugbyGameApi, providedIn: "root" });
5802
+ RugbyGameApi = __decorate([
5803
+ Injectable({ providedIn: 'root' })
5804
+ ], RugbyGameApi);
5805
+
5442
5806
  let TeamInviteExternal = class TeamInviteExternal extends BaseModel {
5443
5807
  static toFront(data) { }
5444
5808
  static toBack(data) { }
@@ -6953,6 +7317,41 @@ const OvertimeTypeLocalization = {
6953
7317
  [OvertimeTypes.time_and_penalties]: 'Дополнительное время + пенальти'
6954
7318
  };
6955
7319
 
7320
+ const RugbyGameLogTypeLocalization = {
7321
+ [RugbyGameLogTypes.enter_game]: 'Выход на площадку',
7322
+ [RugbyGameLogTypes.exit_game]: 'Ушел с площадки',
7323
+ [RugbyGameLogTypes.try]: 'Попытка',
7324
+ [RugbyGameLogTypes.penalty_try]: 'Штрафная попытка',
7325
+ [RugbyGameLogTypes.conversion_goal]: 'Реализация',
7326
+ [RugbyGameLogTypes.conversion_miss]: 'Реализация промах',
7327
+ [RugbyGameLogTypes.drawing_ball]: 'Розыгрыш мяча',
7328
+ [RugbyGameLogTypes.penalty_miss]: 'Штрафной промах',
7329
+ [RugbyGameLogTypes.penalty_goal]: 'Штрафной гол',
7330
+ [RugbyGameLogTypes.drop_goal]: 'Дроп-гол',
7331
+ [RugbyGameLogTypes.drop_goal_miss]: 'Дроп-гол промах',
7332
+ [RugbyGameLogTypes.free_kick]: 'Свободный удар',
7333
+ [RugbyGameLogTypes.yellow_card]: 'Желтая карточка',
7334
+ [RugbyGameLogTypes.red_card]: 'Красная карточка',
7335
+ [RugbyGameLogTypes.offload]: 'Скидка при завхвате',
7336
+ [RugbyGameLogTypes.tackle]: 'Успешный захват',
7337
+ [RugbyGameLogTypes.out]: 'Аут',
7338
+ [RugbyGameLogTypes.handling_error]: 'Ошибка приема',
7339
+ [RugbyGameLogTypes.carries_other_gainline]: 'Прорыв линии',
7340
+ [RugbyGameLogTypes.timeout]: 'Таймаут',
7341
+ [RugbyGameLogTypes.scrum_won]: 'Свахтка выиграна',
7342
+ [RugbyGameLogTypes.scrum_lose]: 'Схватка проиграна',
7343
+ [RugbyGameLogTypes.scrum_won_free]: 'Схватка выиграна без сопротивления',
7344
+ [RugbyGameLogTypes.lineout_success]: 'Корридор выиграно',
7345
+ [RugbyGameLogTypes.lineout_loss]: 'Корридор потеря',
7346
+ [RugbyGameLogTypes.lineout_steal]: 'Корридор перехват',
7347
+ [RugbyGameLogTypes.quick_throw]: 'Быстрый вброс',
7348
+ [RugbyGameLogTypes.ruck_won]: 'Рак выиграно',
7349
+ [RugbyGameLogTypes.ruck_lose]: 'Рак проиграно',
7350
+ [RugbyGameLogTypes.maul_won]: 'Мол выиграно',
7351
+ [RugbyGameLogTypes.maul_lose]: 'Мол проиграно',
7352
+ [RugbyGameLogTypes.team_foul]: 'Фол',
7353
+ };
7354
+
6956
7355
  const TeamUserRoleLocalization = {
6957
7356
  [TeamUserRole.member]: 'Пользователь',
6958
7357
  [TeamUserRole.moderator]: 'Модератор',
@@ -7032,6 +7431,14 @@ const GameHandballPositionLocalization = {
7032
7431
  [GameHandballPosition.centre_back]: 'Центральный',
7033
7432
  [GameHandballPosition.fullback]: 'Полусредний',
7034
7433
  };
7434
+ const GameRugbyPositionLocalization = {
7435
+ [GameRugbyPosition.front_line]: 'Надающий первой линии',
7436
+ [GameRugbyPosition.second_line]: 'Нападающий второй линии',
7437
+ [GameRugbyPosition.back_line]: 'Нападающий задней линии',
7438
+ [GameRugbyPosition.halfback]: 'Полузащитник',
7439
+ [GameRugbyPosition.three_quarter]: 'Трехчетвертный',
7440
+ [GameRugbyPosition.fullback]: 'Замыкающий'
7441
+ };
7035
7442
 
7036
7443
  const VolleyballGameLogTypeLocalization = {
7037
7444
  [VolleyballGameLogType.enter_game]: 'Выход на площадку',
@@ -7082,6 +7489,36 @@ LeaguePlaylist = __decorate([
7082
7489
  })
7083
7490
  ], LeaguePlaylist);
7084
7491
 
7492
+ let RugbyGameConfig = class RugbyGameConfig extends BaseModel {
7493
+ static toFront(data) { }
7494
+ static toBack(data) { }
7495
+ };
7496
+ __decorate([
7497
+ ToFrontHook
7498
+ ], RugbyGameConfig, "toFront", null);
7499
+ __decorate([
7500
+ ToBackHook
7501
+ ], RugbyGameConfig, "toBack", null);
7502
+ RugbyGameConfig = __decorate([
7503
+ ModelInstance({
7504
+ mappingFields: {
7505
+ periods_count: 'periodsCount',
7506
+ period_time: 'periodTime',
7507
+ overtime_type: 'overtimeType',
7508
+ overtime_time: 'overtimeTime',
7509
+ overtime_periods: 'overtimePeriods',
7510
+ max_game_players: 'maxGamePlayers',
7511
+ game_time_type: 'gameTimeType',
7512
+ substitute_count: 'substituteCount',
7513
+ free_substitute_enabled: 'freeSubstituteEnabled',
7514
+ },
7515
+ relation: {
7516
+ overtimeType: enumField(OvertimeTypes),
7517
+ gameTimeType: enumField(GameTimeTypes),
7518
+ }
7519
+ })
7520
+ ], RugbyGameConfig);
7521
+
7085
7522
  let CentrifugoService = class CentrifugoService {
7086
7523
  constructor(httpClient, configService) {
7087
7524
  this.httpClient = httpClient;
@@ -7450,5 +7887,5 @@ HttpCookieInterceptor = __decorate([
7450
7887
  * Generated bundle index. Do not edit.
7451
7888
  */
7452
7889
 
7453
- export { BannerLocation, BaseModel, BaseService, BasketballGameApi, BasketballGameConfig, BasketballGameLog, BasketballGameLogTypeLocalization, BasketballGameLogTypes, BasketballGameStatistic, BasketballGameTeamStatistic, BasketballProfile, BasketballStatistic, BasketballStatisticTypes, CONFIG_DATA, CentrifugoService, City, ConfigService, DateField, DateTimeField, FAULT_LOG_TYPES, Feedback, FeedbackApi, File, FileApi, FileEngine, FootballGameApi, FootballGameConfig, FootballGameLog, FootballGameLogTypeLocalization, FootballGameLogTypes, FootballGameStatistic, FootballGameTeamStatistic, FootballProfile, FootballStatistic, FootballWorkFoot, FootballWorkFootLocalization, Game, GameBaseApi, GameBasketballPosition, GameBasketballPositionLocalization, GameBasketballPositionShortLocalization, GameFootballPosition, GameFootballPositionLocalization, GameHandballPosition, GameHandballPositionLocalization, GameHockeyPosition, GameHockeyPositionLocalization, GameInvite, GameInviteStatus, GameResultTypes, GameStatuses, GameTimeTypes, GameTimelineStageItem, GameTimelineStages, GameUser, GameUserLimitationTypes, GameUserLimitations, GameVolleyballPosition, GameVolleyballPositionLocalization, GameVolleyballPositionShortLocalization, GameVolleyballPositionShortRuLocalization, HandballGameApi, HandballGameConfig, HandballGameLog, HandballGameLogTypeLocalization, HandballGameLogTypes, HandballGameStatistic, HandballGameTeamStatistic, HandballProfile, HandballStatistic, HockeyAdvantageTypes, HockeyGameApi, HockeyGameConfig, HockeyGameLog, HockeyGameLogTypeLocalization, HockeyGameLogTypes, HockeyGameStatistic, HockeyGameTeamStatistic, HockeyPenaltyTypes, HockeyProfile, HockeyStatistic, HockeyWorkHand, HttpCookieInterceptor, League, LeagueApi, LeagueBanner, LeagueCourt, LeagueDocument, LeagueNews, LeagueNewsApi, LeagueNewsType, LeaguePartner, LeaguePlayer, LeaguePlayerApi, LeaguePlaylist, LocalStorageEngine, MODEL_MAPPING_FIELDS_KEY, MODEL_RELATION_KEY, MODEL_TO_BACK_KEY, MODEL_TO_FRONT_KEY, MediaApi, MediaItem, ModelInstance, Notification, NotificationAllowTypes, NotificationApi, NotificationBaseApi, NotificationServiceEnum, NotificationSettings, NotificationType, OrgNotificationApi, Organization, OvertimeTypeLocalization, OvertimeTypes, Playoff, PlayoffSettings, PlayoffTypes, Poll, PollAnswer, PollStatuses, PollVariant, PublicTeamApi, PublicUserApi, ReferenceApi, SCORE_LOG_TYPES, Sport, SportTypes, StorageEngine, StorageEngineField, Store, Team, TeamAccess, TeamApi, TeamEvent, TeamEventApi, TeamEventInvite, TeamEventInviteStatuses, TeamEventTypeLocalization, TeamEventTypes, TeamInvite, TeamInviteExternal, TeamPermission, TeamPermissionTypes, TeamUser, TeamUserRole, TeamUserRoleLocalization, ToBackHook, ToFrontHook, Tournament, TournamentApi, TournamentDisqualification, TournamentEvent, TournamentEventTypes, TournamentGender, TournamentGroup, TournamentInvite, TournamentJoinApi, TournamentJoinData, TournamentJoinTeam, TournamentNews, TournamentSeason, TournamentSeasonApi, TournamentSeasonStatuses, TournamentSettings, TournamentStage, TournamentStageApi, TournamentStageStatuses, TournamentStageTeam, TournamentStatuses, TournamentTeam, TournamentTeamShort, TournamentTeamUser, TournamentTeamUserInvite, TournamentTeamWinner, TournamentTypes, UntilDestroy, User, UserAccess, UserApi, UserGender, UserPermission, UserPermissionTypes, UserProfile, VolleyballGameApi, VolleyballGameConfig, VolleyballGameLog, VolleyballGameLogType, VolleyballGameLogTypeLocalization, VolleyballGameStatistic, VolleyballGameTeamStatistic, VolleyballGameTypes, VolleyballProfile, VolleyballStatistic, VolleyballStatisticTypes, VolleyballWorkHand, VolleyballWorkHandLocalization, WorkHand, WorkHandLocalization, addItemInArray, changeFavicons, componentDestroyed, deleteItemFromArray, enumField, fileSizeValidator, generateArray, getArrayChunks, getCookie, getEnumOptions, getIconsData, handleError, isTouchDevice, listField, markFormGroupTouched, minLengthArrayValidator, patchItemInArray, penaltyTypeField, updateItemInArray, updateItemsInArray, validateDate, validateEmail, validatePhone, validateUrl };
7890
+ export { BannerLocation, BaseModel, BaseService, BasketballGameApi, BasketballGameConfig, BasketballGameLog, BasketballGameLogTypeLocalization, BasketballGameLogTypes, BasketballGameStatistic, BasketballGameTeamStatistic, BasketballProfile, BasketballStatistic, BasketballStatisticTypes, CONFIG_DATA, CentrifugoService, City, ConfigService, DateField, DateTimeField, FAULT_LOG_TYPES, Feedback, FeedbackApi, File, FileApi, FileEngine, FootballGameApi, FootballGameConfig, FootballGameLog, FootballGameLogTypeLocalization, FootballGameLogTypes, FootballGameStatistic, FootballGameTeamStatistic, FootballProfile, FootballStatistic, FootballWorkFoot, FootballWorkFootLocalization, Game, GameBaseApi, GameBasketballPosition, GameBasketballPositionLocalization, GameBasketballPositionShortLocalization, GameFootballPosition, GameFootballPositionLocalization, GameHandballPosition, GameHandballPositionLocalization, GameHockeyPosition, GameHockeyPositionLocalization, GameInvite, GameInviteStatus, GameResultTypes, GameRugbyPosition, GameRugbyPositionLocalization, GameStatuses, GameTimeTypes, GameTimelineStageItem, GameTimelineStages, GameUser, GameUserLimitationTypes, GameUserLimitations, GameVolleyballPosition, GameVolleyballPositionLocalization, GameVolleyballPositionShortLocalization, GameVolleyballPositionShortRuLocalization, HandballGameApi, HandballGameConfig, HandballGameLog, HandballGameLogTypeLocalization, HandballGameLogTypes, HandballGameStatistic, HandballGameTeamStatistic, HandballProfile, HandballStatistic, HockeyAdvantageTypes, HockeyGameApi, HockeyGameConfig, HockeyGameLog, HockeyGameLogTypeLocalization, HockeyGameLogTypes, HockeyGameStatistic, HockeyGameTeamStatistic, HockeyPenaltyTypes, HockeyProfile, HockeyStatistic, HockeyWorkHand, HttpCookieInterceptor, League, LeagueApi, LeagueBanner, LeagueCourt, LeagueDocument, LeagueNews, LeagueNewsApi, LeagueNewsType, LeaguePartner, LeaguePlayer, LeaguePlayerApi, LeaguePlaylist, LocalStorageEngine, MODEL_MAPPING_FIELDS_KEY, MODEL_RELATION_KEY, MODEL_TO_BACK_KEY, MODEL_TO_FRONT_KEY, MediaApi, MediaItem, ModelInstance, Notification, NotificationAllowTypes, NotificationApi, NotificationBaseApi, NotificationServiceEnum, NotificationSettings, NotificationType, OrgNotificationApi, Organization, OvertimeTypeLocalization, OvertimeTypes, Playoff, PlayoffSettings, PlayoffTypes, Poll, PollAnswer, PollStatuses, PollVariant, PublicTeamApi, PublicUserApi, RUGBY_GAME_LOG_TYPE_POINTS, RUGBY_TEAM_LOG_TYPES, ReferenceApi, RugbyGameApi, RugbyGameConfig, RugbyGameLog, RugbyGameLogTypeLocalization, RugbyGameLogTypes, RugbyGameStatistic, RugbyGameTeamStatistic, RugbyProfile, RugbyStatistic, SCORE_LOG_TYPES, Sport, SportTypes, StorageEngine, StorageEngineField, Store, Team, TeamAccess, TeamApi, TeamEvent, TeamEventApi, TeamEventInvite, TeamEventInviteStatuses, TeamEventTypeLocalization, TeamEventTypes, TeamInvite, TeamInviteExternal, TeamPermission, TeamPermissionTypes, TeamUser, TeamUserRole, TeamUserRoleLocalization, ToBackHook, ToFrontHook, Tournament, TournamentApi, TournamentDisqualification, TournamentEvent, TournamentEventTypes, TournamentGender, TournamentGroup, TournamentInvite, TournamentJoinApi, TournamentJoinData, TournamentJoinTeam, TournamentNews, TournamentSeason, TournamentSeasonApi, TournamentSeasonStatuses, TournamentSettings, TournamentStage, TournamentStageApi, TournamentStageStatuses, TournamentStageTeam, TournamentStatuses, TournamentTeam, TournamentTeamShort, TournamentTeamUser, TournamentTeamUserInvite, TournamentTeamWinner, TournamentTypes, UntilDestroy, User, UserAccess, UserApi, UserGender, UserPermission, UserPermissionTypes, UserProfile, VolleyballGameApi, VolleyballGameConfig, VolleyballGameLog, VolleyballGameLogType, VolleyballGameLogTypeLocalization, VolleyballGameStatistic, VolleyballGameTeamStatistic, VolleyballGameTypes, VolleyballProfile, VolleyballStatistic, VolleyballStatisticTypes, VolleyballWorkHand, VolleyballWorkHandLocalization, WorkHand, WorkHandLocalization, addItemInArray, applyGameMediaFilters, applyGamesFilters, applyStatisticFilters, applyStatisticLeadersFilters, changeFavicons, componentDestroyed, deleteItemFromArray, enumField, fileSizeValidator, generateArray, getArrayChunks, getCookie, getEnumOptions, getIconsData, handleError, isTouchDevice, listField, markFormGroupTouched, minLengthArrayValidator, patchItemInArray, penaltyTypeField, updateItemInArray, updateItemsInArray, validateDate, validateEmail, validatePhone, validateUrl };
7454
7891
  //# sourceMappingURL=mtgame-core.js.map