@mtgame/core 0.1.25 → 0.1.27

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.
@@ -1746,6 +1746,86 @@ var Game = /** @class */ (function (_super) {
1746
1746
  function Game() {
1747
1747
  return _super !== null && _super.apply(this, arguments) || this;
1748
1748
  }
1749
+ Object.defineProperty(Game.prototype, "basketballGameConfig", {
1750
+ get: function () {
1751
+ if (this._basketballGameConfig && this._basketballGameConfig.periodsCount) {
1752
+ return this._basketballGameConfig;
1753
+ }
1754
+ if (this.gameConfig) {
1755
+ this._basketballGameConfig = BasketballGameConfig.toFront(this.gameConfig);
1756
+ }
1757
+ return this._basketballGameConfig;
1758
+ },
1759
+ set: function (value) {
1760
+ this._basketballGameConfig = value;
1761
+ },
1762
+ enumerable: true,
1763
+ configurable: true
1764
+ });
1765
+ Object.defineProperty(Game.prototype, "volleyballGameConfig", {
1766
+ get: function () {
1767
+ if (this._volleyballGameConfig && this._volleyballGameConfig.setsCount) {
1768
+ return this._volleyballGameConfig;
1769
+ }
1770
+ if (this.gameConfig) {
1771
+ this._volleyballGameConfig = VolleyballGameConfig.toFront(this.gameConfig);
1772
+ }
1773
+ return this._volleyballGameConfig;
1774
+ },
1775
+ set: function (value) {
1776
+ this._volleyballGameConfig = value;
1777
+ },
1778
+ enumerable: true,
1779
+ configurable: true
1780
+ });
1781
+ Object.defineProperty(Game.prototype, "hockeyGameConfig", {
1782
+ get: function () {
1783
+ if (this._hockeyGameConfig && this._hockeyGameConfig.periodsCount) {
1784
+ return this._hockeyGameConfig;
1785
+ }
1786
+ if (this.gameConfig) {
1787
+ this._hockeyGameConfig = HockeyGameConfig.toFront(this.gameConfig);
1788
+ }
1789
+ return this._hockeyGameConfig;
1790
+ },
1791
+ set: function (value) {
1792
+ this._hockeyGameConfig = value;
1793
+ },
1794
+ enumerable: true,
1795
+ configurable: true
1796
+ });
1797
+ Object.defineProperty(Game.prototype, "handballGameConfig", {
1798
+ get: function () {
1799
+ if (this._handballGameConfig && this._handballGameConfig.periodsCount) {
1800
+ return this._handballGameConfig;
1801
+ }
1802
+ if (this.gameConfig) {
1803
+ this._handballGameConfig = HandballGameConfig.toFront(this.gameConfig);
1804
+ }
1805
+ return this._handballGameConfig;
1806
+ },
1807
+ set: function (value) {
1808
+ this._handballGameConfig = value;
1809
+ },
1810
+ enumerable: true,
1811
+ configurable: true
1812
+ });
1813
+ Object.defineProperty(Game.prototype, "footballGameConfig", {
1814
+ get: function () {
1815
+ if (this._footballGameConfig && this._footballGameConfig.periodsCount) {
1816
+ return this._footballGameConfig;
1817
+ }
1818
+ if (this.gameConfig) {
1819
+ this._footballGameConfig = FootballGameConfig.toFront(this.gameConfig);
1820
+ }
1821
+ return this._footballGameConfig;
1822
+ },
1823
+ set: function (value) {
1824
+ this._footballGameConfig = value;
1825
+ },
1826
+ enumerable: true,
1827
+ configurable: true
1828
+ });
1749
1829
  Object.defineProperty(Game.prototype, "scoreByPeriodList", {
1750
1830
  get: function () {
1751
1831
  var _this = this;
@@ -1828,6 +1908,7 @@ var Game = /** @class */ (function (_super) {
1828
1908
  playoff_number: 'playoffNumber',
1829
1909
  tournament_id: 'tournamentId',
1830
1910
  tournament_tour: 'tournamentTour',
1911
+ game_config: 'gameConfig',
1831
1912
  basketball_game_config: 'basketballGameConfig',
1832
1913
  volleyball_game_config: 'volleyballGameConfig',
1833
1914
  hockey_game_config: 'hockeyGameConfig',
@@ -3563,7 +3644,8 @@ var FootballGameStatistic = /** @class */ (function (_super) {
3563
3644
  if (!this.penaltyAttempts || !this.penaltyGoals) {
3564
3645
  return 0;
3565
3646
  }
3566
- return Math.round(1000 * this.penaltyGoals / this.penaltyAttempts) / 10;
3647
+ var penaltyShots = this.penaltyAttempts + this.penaltyGoals;
3648
+ return Math.round(1000 * this.penaltyGoals / penaltyShots) / 10;
3567
3649
  },
3568
3650
  enumerable: true,
3569
3651
  configurable: true
@@ -3580,7 +3662,8 @@ var FootballGameStatistic = /** @class */ (function (_super) {
3580
3662
  if (!this.smallPenaltyAttempts || !this.smallPenaltyGoals) {
3581
3663
  return 0;
3582
3664
  }
3583
- return Math.round(1000 * this.smallPenaltyGoals / this.smallPenaltyAttempts) / 10;
3665
+ var smallPenaltyShots = this.smallPenaltyAttempts + this.smallPenaltyGoals;
3666
+ return Math.round(1000 * this.smallPenaltyGoals / smallPenaltyShots) / 10;
3584
3667
  },
3585
3668
  enumerable: true,
3586
3669
  configurable: true
@@ -5527,6 +5610,28 @@ var LeagueNewsApi = /** @class */ (function () {
5527
5610
  return LeagueNewsApi;
5528
5611
  }());
5529
5612
 
5613
+ var LeaguePlayerApi = /** @class */ (function () {
5614
+ function LeaguePlayerApi(httpClient, configService) {
5615
+ this.httpClient = httpClient;
5616
+ this.configService = configService;
5617
+ }
5618
+ LeaguePlayerApi.prototype.getById = function (leaguePlayerId) {
5619
+ return this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league_player/" + leaguePlayerId + "/").pipe(map(function (item) { return LeaguePlayer.toFront(item); })).toPromise();
5620
+ };
5621
+ LeaguePlayerApi.prototype.getTournamentUsers = function (leaguePlayerId) {
5622
+ return this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league_player/" + leaguePlayerId + "/tournament_users/").pipe(map(function (item) { return TournamentTeamUser.toFront(item); })).toPromise();
5623
+ };
5624
+ LeaguePlayerApi.ctorParameters = function () { return [
5625
+ { type: HttpClient },
5626
+ { type: ConfigService }
5627
+ ]; };
5628
+ LeaguePlayerApi.ɵprov = ɵɵdefineInjectable({ factory: function LeaguePlayerApi_Factory() { return new LeaguePlayerApi(ɵɵinject(HttpClient), ɵɵinject(ConfigService)); }, token: LeaguePlayerApi, providedIn: "root" });
5629
+ LeaguePlayerApi = __decorate([
5630
+ Injectable({ providedIn: 'root' })
5631
+ ], LeaguePlayerApi);
5632
+ return LeaguePlayerApi;
5633
+ }());
5634
+
5530
5635
  var MediaApi = /** @class */ (function () {
5531
5636
  function MediaApi(httpClient, configService) {
5532
5637
  this.httpClient = httpClient;
@@ -8747,5 +8852,5 @@ var HttpCookieInterceptor = /** @class */ (function () {
8747
8852
  * Generated bundle index. Do not edit.
8748
8853
  */
8749
8854
 
8750
- 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, 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, 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 };
8855
+ 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, 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 };
8751
8856
  //# sourceMappingURL=mtgame-core.js.map