@mtgame/core 0.0.17 → 0.0.19

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,28 @@ function enumField(enumClass) {
49
99
  }
50
100
  };
51
101
  }
102
+ function penaltyTypeField() {
103
+ return {
104
+ toFront: (data) => {
105
+ if (!data) {
106
+ return null;
107
+ }
108
+ if (typeof data === 'object') {
109
+ return data;
110
+ }
111
+ return HockeyPenaltyTypes.find(item => item.id === data);
112
+ },
113
+ toBack: (data) => {
114
+ if (!data) {
115
+ return null;
116
+ }
117
+ if (typeof data === 'object') {
118
+ return data.id;
119
+ }
120
+ return data;
121
+ }
122
+ };
123
+ }
52
124
  function listField(modelClass) {
53
125
  return {
54
126
  toFront: (value) => {
@@ -1903,6 +1975,13 @@ let HockeyGameLog = class HockeyGameLog extends BaseModel {
1903
1975
  isScoreType() {
1904
1976
  return [HockeyGameLogTypes.goal, HockeyGameLogTypes.shootout_goal].indexOf(this.logType) > -1;
1905
1977
  }
1978
+ isPenaltyType() {
1979
+ return [
1980
+ HockeyGameLogTypes.minor_penalty, HockeyGameLogTypes.major_penalty,
1981
+ HockeyGameLogTypes.misconduct_penalty, HockeyGameLogTypes.game_misconduct_penalty,
1982
+ HockeyGameLogTypes.penalty_shot, HockeyGameLogTypes.match_penalty
1983
+ ].indexOf(this.logType) > -1;
1984
+ }
1906
1985
  static toFront(value) { }
1907
1986
  static toBack(value) { }
1908
1987
  };
@@ -1928,11 +2007,13 @@ HockeyGameLog = __decorate([
1928
2007
  is_highlight: 'isHighlight',
1929
2008
  advantage: 'advantage',
1930
2009
  is_goalie: 'isGoalie',
2010
+ penalty_type: 'penaltyType'
1931
2011
  },
1932
2012
  relation: {
1933
2013
  datetime: DateTimeField,
1934
2014
  logType: enumField(HockeyGameLogTypes),
1935
2015
  advantage: enumField(HockeyAdvantageTypes),
2016
+ penaltyType: penaltyTypeField()
1936
2017
  }
1937
2018
  })
1938
2019
  ], HockeyGameLog);
@@ -5251,5 +5332,5 @@ HttpCookieInterceptor = __decorate([
5251
5332
  * Generated bundle index. Do not edit.
5252
5333
  */
5253
5334
 
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 };
5335
+ 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
5336
  //# sourceMappingURL=mtgame-core.js.map