@mtgame/core 0.0.17 → 0.0.18

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.
@@ -10,6 +10,56 @@ import { captureException } from '@sentry/browser';
10
10
  import { FormGroup } from '@angular/forms';
11
11
  import { isPlatformBrowser } from '@angular/common';
12
12
 
13
+ const HockeyPenaltyTypes = [
14
+ { id: 1, code: 'АГРЕС', title: 'Агрессор в драке' },
15
+ { id: 2, code: 'АТ-В-ГОЛ', title: 'Атака в голову или шею' },
16
+ { id: 3, code: 'АТ-ВР', title: 'Атака вратаря' },
17
+ { id: 4, code: 'АТ-СЗ', title: 'Атака сзади' },
18
+ { id: 5, code: 'БЛОК', title: 'Блокировка' },
19
+ { id: 6, code: 'БР-КЛ', title: 'Бросок клюшки' },
20
+ { id: 7, code: 'ВБ-ШБ', title: 'Выброс шайбы' },
21
+ { id: 8, code: 'ГРУБ', title: 'Грубость' },
22
+ { id: 9, code: 'ДИСЦ', title: 'Дисциплинарный штраф' },
23
+ { id: 10, code: 'ДИС-КН', title: 'Дисциплинарный до конца матча' },
24
+ { id: 11, code: 'ДРАКА', title: 'Драка' },
25
+ { id: 12, code: 'ЗАЧИН', title: 'Зачинщик драки' },
26
+ { id: 13, code: 'ЗД-ИГ', title: 'Задержка игры' },
27
+ { id: 14, code: 'ЗД-КЛ-СП', title: 'Задержка клюшки соперника' },
28
+ { id: 15, code: 'ЗД-КЛ', title: 'Задержка клюшкой' },
29
+ { id: 16, code: 'ЗД-СП', title: 'Задержка соперника' },
30
+ { id: 17, code: 'ЗД-ШБ', title: 'Задержка шайбы руками' },
31
+ { id: 18, code: 'СЛ-КЛ', title: 'Игра со сломанной клюшкой' },
32
+ { id: 19, code: 'ВП-КЛ', title: 'Игра высоко поднятой клюшкой' },
33
+ { id: 20, code: 'КЛ-УД', title: 'Колющий удар' },
34
+ { id: 21, code: 'СК-ШТ', title: 'Малый скамеечный штраф' },
35
+ { id: 22, code: 'МШ', title: 'Матч-штраф' },
36
+ { id: 23, code: 'НП-АТ', title: 'Неправильная атака' },
37
+ { id: 24, code: 'ЧС-СТ', title: 'Нарушение численного состава' },
38
+ { id: 25, code: 'НС-КЛ', title: 'Нестандартная клюшка' },
39
+ { id: 26, code: 'НАР-ЭК', title: 'Опасное снаряжение' },
40
+ { id: 27, code: 'НС-ПВ', title: 'Оскорбление судей и неспортивное поведение' },
41
+ { id: 28, code: 'ОТ-ИГ', title: 'Отказ начать игру' },
42
+ { id: 29, code: 'ОТСЧ', title: 'Отсечение' },
43
+ { id: 30, code: 'ПЛЕВОК', title: 'Плевок' },
44
+ { id: 31, code: 'ПОДН', title: 'Подножка' },
45
+ { id: 32, code: 'ПОДС', title: 'Подсечка' },
46
+ { id: 33, code: 'ПР-ИН', title: 'Предупреждение инфекций' },
47
+ { id: 34, code: 'ПК-СК', title: 'Покидание скамейки во время конфликта' },
48
+ { id: 35, code: 'СД-ВР', title: 'Сдвиг ворот' },
49
+ { id: 36, code: 'СИМ', title: 'Симуляция' },
50
+ { id: 37, code: 'ТЛ-БР', title: 'Толчок на борт' },
51
+ { id: 38, code: 'ТЛ-КЛ', title: 'Толчок клюшкой' },
52
+ { id: 39, code: 'УД-ГОЛ', title: 'Удар головой' },
53
+ { id: 40, code: 'УД-КЛ', title: 'Удар клюшкой' },
54
+ { id: 41, code: 'УД-К-КЛ', title: 'Удар концом клюшки' },
55
+ { id: 42, code: 'УД-КОЛ', title: 'Удар коленом' },
56
+ { id: 43, code: 'УД-ЛОК', title: 'Удар локтем' },
57
+ { id: 44, code: 'УД-НГ', title: 'Удар ногой' },
58
+ { id: 45, code: 'УКУС', title: 'Укус' },
59
+ { id: 46, code: 'КН-ЗР', title: 'Физический контакт со зрителем' },
60
+ { id: 47, code: 'ШТ-ВР', title: 'Штраф вратаря' }
61
+ ];
62
+
13
63
  const MODEL_MAPPING_FIELDS_KEY = '_mapping_fields_';
14
64
  const MODEL_RELATION_KEY = '_relation_';
15
65
  const MODEL_TO_FRONT_KEY = '_to_front_';
@@ -49,6 +99,22 @@ function enumField(enumClass) {
49
99
  }
50
100
  };
51
101
  }
102
+ function penaltyTypeField() {
103
+ return {
104
+ toFront: (data) => {
105
+ if (typeof data === 'object') {
106
+ return data;
107
+ }
108
+ return HockeyPenaltyTypes.find(item => item.id === data);
109
+ },
110
+ toBack: (data) => {
111
+ if (typeof data === 'object') {
112
+ return data.id;
113
+ }
114
+ return data;
115
+ }
116
+ };
117
+ }
52
118
  function listField(modelClass) {
53
119
  return {
54
120
  toFront: (value) => {
@@ -1903,6 +1969,13 @@ let HockeyGameLog = class HockeyGameLog extends BaseModel {
1903
1969
  isScoreType() {
1904
1970
  return [HockeyGameLogTypes.goal, HockeyGameLogTypes.shootout_goal].indexOf(this.logType) > -1;
1905
1971
  }
1972
+ isPenaltyType() {
1973
+ return [
1974
+ HockeyGameLogTypes.minor_penalty, HockeyGameLogTypes.major_penalty,
1975
+ HockeyGameLogTypes.misconduct_penalty, HockeyGameLogTypes.game_misconduct_penalty,
1976
+ HockeyGameLogTypes.penalty_shot, HockeyGameLogTypes.match_penalty
1977
+ ].indexOf(this.logType) > -1;
1978
+ }
1906
1979
  static toFront(value) { }
1907
1980
  static toBack(value) { }
1908
1981
  };
@@ -1928,11 +2001,13 @@ HockeyGameLog = __decorate([
1928
2001
  is_highlight: 'isHighlight',
1929
2002
  advantage: 'advantage',
1930
2003
  is_goalie: 'isGoalie',
2004
+ penalty_type: 'penaltyType'
1931
2005
  },
1932
2006
  relation: {
1933
2007
  datetime: DateTimeField,
1934
2008
  logType: enumField(HockeyGameLogTypes),
1935
2009
  advantage: enumField(HockeyAdvantageTypes),
2010
+ penaltyType: penaltyTypeField()
1936
2011
  }
1937
2012
  })
1938
2013
  ], HockeyGameLog);
@@ -5251,5 +5326,5 @@ HttpCookieInterceptor = __decorate([
5251
5326
  * Generated bundle index. Do not edit.
5252
5327
  */
5253
5328
 
5254
- export { BaseModel, BaseService, BaseStatistic, 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, Game, GameBasketballPosition, GameBasketballPositionLocalization, GameBasketballPositionShortLocalization, GameHockeyPosition, GameHockeyPositionLocalization, GameInvite, GameInviteStatus, GameResultTypes, GameStatuses, GameTimeTypes, GameTimelineStageItem, GameTimelineStages, GameUser, GameVolleyballPosition, GameVolleyballPositionLocalization, GameVolleyballPositionShortLocalization, GameVolleyballPositionShortRuLocalization, HockeyAdvantageTypes, HockeyGameApi, HockeyGameConfig, HockeyGameLog, HockeyGameLogTypeLocalization, HockeyGameLogTypes, HockeyGameStatistic, HockeyGameTeamStatistic, HockeyProfile, HockeyStatistic, HockeyWorkHand, HttpCookieInterceptor, League, LeagueApi, LeagueCourt, LeagueNews, LeagueNewsApi, LocalStorageEngine, MediaApi, MediaItem, ModelInstance, Notification, NotificationAllowTypes, NotificationApi, NotificationBaseApi, NotificationServiceEnum, NotificationSettings, NotificationType, OrgNotificationApi, Organization, OvertimeTypeLocalization, OvertimeTypes, Playoff, PlayoffSettings, PlayoffTypes, Poll, PollAnswer, PollStatuses, PollVariant, 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, 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, VolleyballWorkHand, VolleyballWorkHandLocalization, WorkHand, WorkHandLocalization, addItemInArray, changeFavicons, componentDestroyed, deleteItemFromArray, enumField, fileSizeValidator, generateArray, getArrayChunks, getCookie, getEnumOptions, getIconsData, handleError, isTouchDevice, listField, markFormGroupTouched, minLengthArrayValidator, patchItemInArray, updateItemInArray, updateItemsInArray, validateDate, validateEmail, validatePhone, validateUrl };
5329
+ export { BaseModel, BaseService, BaseStatistic, 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, Game, GameBasketballPosition, GameBasketballPositionLocalization, GameBasketballPositionShortLocalization, GameHockeyPosition, GameHockeyPositionLocalization, GameInvite, GameInviteStatus, GameResultTypes, GameStatuses, GameTimeTypes, GameTimelineStageItem, GameTimelineStages, GameUser, GameVolleyballPosition, GameVolleyballPositionLocalization, GameVolleyballPositionShortLocalization, GameVolleyballPositionShortRuLocalization, HockeyAdvantageTypes, HockeyGameApi, HockeyGameConfig, HockeyGameLog, HockeyGameLogTypeLocalization, HockeyGameLogTypes, HockeyGameStatistic, HockeyGameTeamStatistic, HockeyPenaltyTypes, HockeyProfile, HockeyStatistic, HockeyWorkHand, HttpCookieInterceptor, League, LeagueApi, LeagueCourt, LeagueNews, LeagueNewsApi, LocalStorageEngine, MediaApi, MediaItem, ModelInstance, Notification, NotificationAllowTypes, NotificationApi, NotificationBaseApi, NotificationServiceEnum, NotificationSettings, NotificationType, OrgNotificationApi, Organization, OvertimeTypeLocalization, OvertimeTypes, Playoff, PlayoffSettings, PlayoffTypes, Poll, PollAnswer, PollStatuses, PollVariant, 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, 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, VolleyballWorkHand, VolleyballWorkHandLocalization, WorkHand, WorkHandLocalization, addItemInArray, changeFavicons, componentDestroyed, deleteItemFromArray, enumField, fileSizeValidator, generateArray, getArrayChunks, getCookie, getEnumOptions, getIconsData, handleError, isTouchDevice, listField, markFormGroupTouched, minLengthArrayValidator, patchItemInArray, updateItemInArray, updateItemsInArray, validateDate, validateEmail, validatePhone, validateUrl, penaltyTypeField as ɵa };
5255
5330
  //# sourceMappingURL=mtgame-core.js.map