@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.
@@ -0,0 +1,11 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { ConfigService } from '../services/config.service';
3
+ import { LeaguePlayer } from '../models/league-player';
4
+ import { TournamentTeamUser } from '../models/tournament-team-user';
5
+ export declare class LeaguePlayerApi {
6
+ private httpClient;
7
+ private configService;
8
+ constructor(httpClient: HttpClient, configService: ConfigService);
9
+ getById(leaguePlayerId: number): Promise<LeaguePlayer>;
10
+ getTournamentUsers(leaguePlayerId: number): Promise<TournamentTeamUser[]>;
11
+ }
@@ -7,6 +7,7 @@ export * from './football-game-api';
7
7
  export * from './handball-game-api';
8
8
  export { LeagueApi } from './league-api';
9
9
  export * from './league-news-api';
10
+ export * from './league-player-api';
10
11
  export { MediaApi, GameMediaFilters } from './media-api';
11
12
  export * from './notification-api';
12
13
  export * from './notification-base-api';
@@ -32,12 +32,13 @@ export interface TournamentGamesFilters {
32
32
  userId?: number;
33
33
  query?: string;
34
34
  }
35
- export declare type StatisticGroupByTypes = 'team' | 'user' | 'team_user' | 'tournament_team' | 'tournament_team_user' | 'month' | 'win_loses';
35
+ export declare type StatisticGroupByTypes = 'team' | 'user' | 'team_user' | 'tournament_team' | 'league_player' | 'tournament_team_user' | 'month' | 'win_loses';
36
36
  export interface StatisticFilters {
37
37
  tournament_id?: number;
38
38
  tournament_ids?: number[];
39
39
  tournament_season_id?: number;
40
40
  tournament_team_id?: number;
41
+ league_player_id?: number;
41
42
  tournament_team_user_id?: number;
42
43
  team_id?: number;
43
44
  team_user_id?: number;
@@ -1959,6 +1959,86 @@
1959
1959
  function Game() {
1960
1960
  return _super !== null && _super.apply(this, arguments) || this;
1961
1961
  }
1962
+ Object.defineProperty(Game.prototype, "basketballGameConfig", {
1963
+ get: function () {
1964
+ if (this._basketballGameConfig && this._basketballGameConfig.periodsCount) {
1965
+ return this._basketballGameConfig;
1966
+ }
1967
+ if (this.gameConfig) {
1968
+ this._basketballGameConfig = BasketballGameConfig.toFront(this.gameConfig);
1969
+ }
1970
+ return this._basketballGameConfig;
1971
+ },
1972
+ set: function (value) {
1973
+ this._basketballGameConfig = value;
1974
+ },
1975
+ enumerable: true,
1976
+ configurable: true
1977
+ });
1978
+ Object.defineProperty(Game.prototype, "volleyballGameConfig", {
1979
+ get: function () {
1980
+ if (this._volleyballGameConfig && this._volleyballGameConfig.setsCount) {
1981
+ return this._volleyballGameConfig;
1982
+ }
1983
+ if (this.gameConfig) {
1984
+ this._volleyballGameConfig = VolleyballGameConfig.toFront(this.gameConfig);
1985
+ }
1986
+ return this._volleyballGameConfig;
1987
+ },
1988
+ set: function (value) {
1989
+ this._volleyballGameConfig = value;
1990
+ },
1991
+ enumerable: true,
1992
+ configurable: true
1993
+ });
1994
+ Object.defineProperty(Game.prototype, "hockeyGameConfig", {
1995
+ get: function () {
1996
+ if (this._hockeyGameConfig && this._hockeyGameConfig.periodsCount) {
1997
+ return this._hockeyGameConfig;
1998
+ }
1999
+ if (this.gameConfig) {
2000
+ this._hockeyGameConfig = HockeyGameConfig.toFront(this.gameConfig);
2001
+ }
2002
+ return this._hockeyGameConfig;
2003
+ },
2004
+ set: function (value) {
2005
+ this._hockeyGameConfig = value;
2006
+ },
2007
+ enumerable: true,
2008
+ configurable: true
2009
+ });
2010
+ Object.defineProperty(Game.prototype, "handballGameConfig", {
2011
+ get: function () {
2012
+ if (this._handballGameConfig && this._handballGameConfig.periodsCount) {
2013
+ return this._handballGameConfig;
2014
+ }
2015
+ if (this.gameConfig) {
2016
+ this._handballGameConfig = HandballGameConfig.toFront(this.gameConfig);
2017
+ }
2018
+ return this._handballGameConfig;
2019
+ },
2020
+ set: function (value) {
2021
+ this._handballGameConfig = value;
2022
+ },
2023
+ enumerable: true,
2024
+ configurable: true
2025
+ });
2026
+ Object.defineProperty(Game.prototype, "footballGameConfig", {
2027
+ get: function () {
2028
+ if (this._footballGameConfig && this._footballGameConfig.periodsCount) {
2029
+ return this._footballGameConfig;
2030
+ }
2031
+ if (this.gameConfig) {
2032
+ this._footballGameConfig = FootballGameConfig.toFront(this.gameConfig);
2033
+ }
2034
+ return this._footballGameConfig;
2035
+ },
2036
+ set: function (value) {
2037
+ this._footballGameConfig = value;
2038
+ },
2039
+ enumerable: true,
2040
+ configurable: true
2041
+ });
1962
2042
  Object.defineProperty(Game.prototype, "scoreByPeriodList", {
1963
2043
  get: function () {
1964
2044
  var _this = this;
@@ -2041,6 +2121,7 @@
2041
2121
  playoff_number: 'playoffNumber',
2042
2122
  tournament_id: 'tournamentId',
2043
2123
  tournament_tour: 'tournamentTour',
2124
+ game_config: 'gameConfig',
2044
2125
  basketball_game_config: 'basketballGameConfig',
2045
2126
  volleyball_game_config: 'volleyballGameConfig',
2046
2127
  hockey_game_config: 'hockeyGameConfig',
@@ -3776,7 +3857,8 @@
3776
3857
  if (!this.penaltyAttempts || !this.penaltyGoals) {
3777
3858
  return 0;
3778
3859
  }
3779
- return Math.round(1000 * this.penaltyGoals / this.penaltyAttempts) / 10;
3860
+ var penaltyShots = this.penaltyAttempts + this.penaltyGoals;
3861
+ return Math.round(1000 * this.penaltyGoals / penaltyShots) / 10;
3780
3862
  },
3781
3863
  enumerable: true,
3782
3864
  configurable: true
@@ -3793,7 +3875,8 @@
3793
3875
  if (!this.smallPenaltyAttempts || !this.smallPenaltyGoals) {
3794
3876
  return 0;
3795
3877
  }
3796
- return Math.round(1000 * this.smallPenaltyGoals / this.smallPenaltyAttempts) / 10;
3878
+ var smallPenaltyShots = this.smallPenaltyAttempts + this.smallPenaltyGoals;
3879
+ return Math.round(1000 * this.smallPenaltyGoals / smallPenaltyShots) / 10;
3797
3880
  },
3798
3881
  enumerable: true,
3799
3882
  configurable: true
@@ -5740,6 +5823,28 @@
5740
5823
  return LeagueNewsApi;
5741
5824
  }());
5742
5825
 
5826
+ var LeaguePlayerApi = /** @class */ (function () {
5827
+ function LeaguePlayerApi(httpClient, configService) {
5828
+ this.httpClient = httpClient;
5829
+ this.configService = configService;
5830
+ }
5831
+ LeaguePlayerApi.prototype.getById = function (leaguePlayerId) {
5832
+ return this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league_player/" + leaguePlayerId + "/").pipe(operators.map(function (item) { return LeaguePlayer.toFront(item); })).toPromise();
5833
+ };
5834
+ LeaguePlayerApi.prototype.getTournamentUsers = function (leaguePlayerId) {
5835
+ return this.httpClient.get(this.configService.get('apiUrl') + "/api/v1/league_player/" + leaguePlayerId + "/tournament_users/").pipe(operators.map(function (item) { return TournamentTeamUser.toFront(item); })).toPromise();
5836
+ };
5837
+ LeaguePlayerApi.ctorParameters = function () { return [
5838
+ { type: http.HttpClient },
5839
+ { type: ConfigService }
5840
+ ]; };
5841
+ LeaguePlayerApi.ɵprov = core.ɵɵdefineInjectable({ factory: function LeaguePlayerApi_Factory() { return new LeaguePlayerApi(core.ɵɵinject(http.HttpClient), core.ɵɵinject(ConfigService)); }, token: LeaguePlayerApi, providedIn: "root" });
5842
+ LeaguePlayerApi = __decorate([
5843
+ core.Injectable({ providedIn: 'root' })
5844
+ ], LeaguePlayerApi);
5845
+ return LeaguePlayerApi;
5846
+ }());
5847
+
5743
5848
  var MediaApi = /** @class */ (function () {
5744
5849
  function MediaApi(httpClient, configService) {
5745
5850
  this.httpClient = httpClient;
@@ -9029,6 +9134,7 @@
9029
9134
  exports.LeagueNewsApi = LeagueNewsApi;
9030
9135
  exports.LeaguePartner = LeaguePartner;
9031
9136
  exports.LeaguePlayer = LeaguePlayer;
9137
+ exports.LeaguePlayerApi = LeaguePlayerApi;
9032
9138
  exports.LeaguePlaylist = LeaguePlaylist;
9033
9139
  exports.LocalStorageEngine = LocalStorageEngine;
9034
9140
  exports.MODEL_MAPPING_FIELDS_KEY = MODEL_MAPPING_FIELDS_KEY;