volleyballsimtypes 0.0.75 → 0.0.77

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 (143) hide show
  1. package/dist/cjs/src/api/events.d.ts +14 -14
  2. package/dist/cjs/src/api/index.d.ts +7 -8
  3. package/dist/cjs/src/api/index.js +21 -3
  4. package/dist/cjs/src/data/index.d.ts +3 -6
  5. package/dist/cjs/src/data/index.js +18 -125
  6. package/dist/cjs/src/data/models/block.d.ts +3 -1
  7. package/dist/cjs/src/data/models/block.js +8 -7
  8. package/dist/cjs/src/data/models/event.d.ts +3 -1
  9. package/dist/cjs/src/data/models/event.js +8 -7
  10. package/dist/cjs/src/data/models/index.d.ts +32 -64
  11. package/dist/cjs/src/data/models/index.js +46 -65
  12. package/dist/cjs/src/data/models/iteration.d.ts +1 -1
  13. package/dist/cjs/src/data/models/iteration.js +2 -2
  14. package/dist/cjs/src/data/models/reception.d.ts +3 -1
  15. package/dist/cjs/src/data/models/reception.js +8 -7
  16. package/dist/cjs/src/data/models/serve.d.ts +3 -1
  17. package/dist/cjs/src/data/models/serve.js +8 -7
  18. package/dist/cjs/src/data/models/set.d.ts +3 -1
  19. package/dist/cjs/src/data/models/set.js +8 -7
  20. package/dist/cjs/src/data/models/spike.d.ts +3 -1
  21. package/dist/cjs/src/data/models/spike.js +8 -7
  22. package/dist/cjs/src/data/transformers/block.js +16 -14
  23. package/dist/cjs/src/data/transformers/court-target.d.ts +3 -3
  24. package/dist/cjs/src/data/transformers/court-target.js +14 -14
  25. package/dist/cjs/src/data/transformers/event-type.d.ts +3 -3
  26. package/dist/cjs/src/data/transformers/event-type.js +9 -9
  27. package/dist/cjs/src/data/transformers/index.d.ts +35 -36
  28. package/dist/cjs/src/data/transformers/index.js +49 -124
  29. package/dist/cjs/src/data/transformers/libero-replacement.js +3 -3
  30. package/dist/cjs/src/data/transformers/rally.js +8 -8
  31. package/dist/cjs/src/data/transformers/reception.js +15 -13
  32. package/dist/cjs/src/data/transformers/serve.js +16 -14
  33. package/dist/cjs/src/data/transformers/set.js +15 -13
  34. package/dist/cjs/src/data/transformers/spike.js +17 -15
  35. package/dist/cjs/src/index.d.ts +3 -6
  36. package/dist/cjs/src/index.js +17 -185
  37. package/dist/cjs/src/service/event/__stubs__/index.js +7 -6
  38. package/dist/cjs/src/service/event/block.d.ts +7 -7
  39. package/dist/cjs/src/service/event/block.js +24 -24
  40. package/dist/cjs/src/service/event/block.test.js +35 -30
  41. package/dist/cjs/src/service/event/in-play-event.d.ts +7 -5
  42. package/dist/cjs/src/service/event/in-play-event.js +6 -5
  43. package/dist/cjs/src/service/event/libero-replacement.d.ts +4 -4
  44. package/dist/cjs/src/service/event/libero-replacement.js +8 -8
  45. package/dist/cjs/src/service/event/libero-replacement.test.js +7 -7
  46. package/dist/cjs/src/service/event/rally-event.d.ts +3 -3
  47. package/dist/cjs/src/service/event/rally-event.js +12 -12
  48. package/dist/cjs/src/service/event/reception.d.ts +8 -8
  49. package/dist/cjs/src/service/event/reception.js +19 -19
  50. package/dist/cjs/src/service/event/reception.test.js +17 -15
  51. package/dist/cjs/src/service/event/score.test.js +2 -2
  52. package/dist/cjs/src/service/event/serve.d.ts +8 -8
  53. package/dist/cjs/src/service/event/serve.js +20 -20
  54. package/dist/cjs/src/service/event/serve.test.js +17 -15
  55. package/dist/cjs/src/service/event/set.d.ts +8 -8
  56. package/dist/cjs/src/service/event/set.js +19 -19
  57. package/dist/cjs/src/service/event/set.test.js +17 -15
  58. package/dist/cjs/src/service/event/spike.d.ts +8 -8
  59. package/dist/cjs/src/service/event/spike.js +22 -22
  60. package/dist/cjs/src/service/event/spike.test.js +23 -20
  61. package/dist/cjs/src/service/match/{court-target.d.ts → court-target-enum.d.ts} +4 -4
  62. package/dist/cjs/src/service/match/court-target-enum.js +42 -0
  63. package/dist/cjs/src/service/match/court-target.test.js +18 -18
  64. package/dist/cjs/src/service/match/index.d.ts +1 -1
  65. package/dist/cjs/src/service/match/index.js +1 -1
  66. package/dist/cjs/src/service/match/rally.js +1 -1
  67. package/dist/cjs/src/service/match/rally.test.js +2 -2
  68. package/dist/cjs/src/service/player/role.d.ts +1 -1
  69. package/dist/cjs/src/service/team/team.d.ts +3 -3
  70. package/dist/cjs/src/service/team/team.js +6 -6
  71. package/dist/esm/src/api/events.d.ts +14 -14
  72. package/dist/esm/src/api/index.d.ts +7 -8
  73. package/dist/esm/src/api/index.js +7 -2
  74. package/dist/esm/src/data/index.d.ts +3 -6
  75. package/dist/esm/src/data/index.js +3 -4
  76. package/dist/esm/src/data/models/block.d.ts +3 -1
  77. package/dist/esm/src/data/models/block.js +8 -7
  78. package/dist/esm/src/data/models/event.d.ts +3 -1
  79. package/dist/esm/src/data/models/event.js +8 -7
  80. package/dist/esm/src/data/models/index.d.ts +32 -64
  81. package/dist/esm/src/data/models/index.js +32 -33
  82. package/dist/esm/src/data/models/iteration.d.ts +1 -1
  83. package/dist/esm/src/data/models/iteration.js +2 -2
  84. package/dist/esm/src/data/models/reception.d.ts +3 -1
  85. package/dist/esm/src/data/models/reception.js +8 -7
  86. package/dist/esm/src/data/models/serve.d.ts +3 -1
  87. package/dist/esm/src/data/models/serve.js +8 -7
  88. package/dist/esm/src/data/models/set.d.ts +3 -1
  89. package/dist/esm/src/data/models/set.js +8 -7
  90. package/dist/esm/src/data/models/spike.d.ts +3 -1
  91. package/dist/esm/src/data/models/spike.js +8 -7
  92. package/dist/esm/src/data/transformers/block.js +18 -16
  93. package/dist/esm/src/data/transformers/court-target.d.ts +3 -3
  94. package/dist/esm/src/data/transformers/court-target.js +15 -15
  95. package/dist/esm/src/data/transformers/event-type.d.ts +3 -3
  96. package/dist/esm/src/data/transformers/event-type.js +10 -10
  97. package/dist/esm/src/data/transformers/index.d.ts +35 -36
  98. package/dist/esm/src/data/transformers/index.js +35 -36
  99. package/dist/esm/src/data/transformers/libero-replacement.js +4 -4
  100. package/dist/esm/src/data/transformers/rally.js +9 -9
  101. package/dist/esm/src/data/transformers/reception.js +17 -15
  102. package/dist/esm/src/data/transformers/serve.js +18 -16
  103. package/dist/esm/src/data/transformers/set.js +17 -15
  104. package/dist/esm/src/data/transformers/spike.js +19 -17
  105. package/dist/esm/src/index.d.ts +3 -6
  106. package/dist/esm/src/index.js +3 -4
  107. package/dist/esm/src/service/event/__stubs__/index.js +10 -9
  108. package/dist/esm/src/service/event/block.d.ts +7 -7
  109. package/dist/esm/src/service/event/block.js +23 -23
  110. package/dist/esm/src/service/event/block.test.js +38 -33
  111. package/dist/esm/src/service/event/in-play-event.d.ts +7 -5
  112. package/dist/esm/src/service/event/in-play-event.js +6 -5
  113. package/dist/esm/src/service/event/libero-replacement.d.ts +4 -4
  114. package/dist/esm/src/service/event/libero-replacement.js +8 -8
  115. package/dist/esm/src/service/event/libero-replacement.test.js +9 -9
  116. package/dist/esm/src/service/event/rally-event.d.ts +3 -3
  117. package/dist/esm/src/service/event/rally-event.js +11 -11
  118. package/dist/esm/src/service/event/reception.d.ts +8 -8
  119. package/dist/esm/src/service/event/reception.js +18 -18
  120. package/dist/esm/src/service/event/reception.test.js +20 -18
  121. package/dist/esm/src/service/event/score.test.js +3 -3
  122. package/dist/esm/src/service/event/serve.d.ts +8 -8
  123. package/dist/esm/src/service/event/serve.js +19 -19
  124. package/dist/esm/src/service/event/serve.test.js +20 -18
  125. package/dist/esm/src/service/event/set.d.ts +8 -8
  126. package/dist/esm/src/service/event/set.js +18 -18
  127. package/dist/esm/src/service/event/set.test.js +20 -18
  128. package/dist/esm/src/service/event/spike.d.ts +8 -8
  129. package/dist/esm/src/service/event/spike.js +21 -21
  130. package/dist/esm/src/service/event/spike.test.js +26 -23
  131. package/dist/esm/src/service/match/{court-target.d.ts → court-target-enum.d.ts} +4 -4
  132. package/dist/esm/src/service/match/court-target-enum.js +39 -0
  133. package/dist/esm/src/service/match/court-target.test.js +18 -18
  134. package/dist/esm/src/service/match/index.d.ts +1 -1
  135. package/dist/esm/src/service/match/index.js +1 -1
  136. package/dist/esm/src/service/match/rally.js +2 -2
  137. package/dist/esm/src/service/match/rally.test.js +3 -3
  138. package/dist/esm/src/service/player/role.d.ts +1 -1
  139. package/dist/esm/src/service/team/team.d.ts +3 -3
  140. package/dist/esm/src/service/team/team.js +6 -6
  141. package/package.json +1 -1
  142. package/dist/cjs/src/service/match/court-target.js +0 -42
  143. package/dist/esm/src/service/match/court-target.js +0 -39
@@ -1,5 +1,5 @@
1
1
  import { CourtPosition } from './court-position';
2
- export declare enum CourtTarget {
2
+ export declare enum CourtTargetEnum {
3
3
  NO_TARGET = 0,
4
4
  OPPONENT_RIGHT_BACK = 7,
5
5
  OPPONENT_MIDDLE_BACK = 12,
@@ -14,8 +14,8 @@ export declare enum CourtTarget {
14
14
  TEAM_MIDDLE_BACK = 6,
15
15
  TEAM_RIGHT_BACK = 1
16
16
  }
17
- export declare namespace CourtTarget {
18
- function getTeamSide(): CourtTarget[];
19
- function getOpponentSide(): CourtTarget[];
17
+ export declare namespace CourtTargetEnum {
18
+ function getTeamSide(): CourtTargetEnum[];
19
+ function getOpponentSide(): CourtTargetEnum[];
20
20
  function getSidePosition(position: number): CourtPosition;
21
21
  }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CourtTargetEnum = void 0;
4
+ var CourtTargetEnum;
5
+ (function (CourtTargetEnum) {
6
+ CourtTargetEnum[CourtTargetEnum["NO_TARGET"] = 0] = "NO_TARGET";
7
+ CourtTargetEnum[CourtTargetEnum["OPPONENT_RIGHT_BACK"] = 7] = "OPPONENT_RIGHT_BACK";
8
+ CourtTargetEnum[CourtTargetEnum["OPPONENT_MIDDLE_BACK"] = 12] = "OPPONENT_MIDDLE_BACK";
9
+ CourtTargetEnum[CourtTargetEnum["OPPONENT_LEFT_BACK"] = 11] = "OPPONENT_LEFT_BACK";
10
+ CourtTargetEnum[CourtTargetEnum["OPPONENT_RIGHT_FRONT"] = 8] = "OPPONENT_RIGHT_FRONT";
11
+ CourtTargetEnum[CourtTargetEnum["OPPONENT_MIDDLE_FRONT"] = 9] = "OPPONENT_MIDDLE_FRONT";
12
+ CourtTargetEnum[CourtTargetEnum["OPPONENT_LEFT_FRONT"] = 10] = "OPPONENT_LEFT_FRONT";
13
+ // --------------------------------------------------------------------------------
14
+ CourtTargetEnum[CourtTargetEnum["TEAM_LEFT_FRONT"] = 4] = "TEAM_LEFT_FRONT";
15
+ CourtTargetEnum[CourtTargetEnum["TEAM_MIDDLE_FRONT"] = 3] = "TEAM_MIDDLE_FRONT";
16
+ CourtTargetEnum[CourtTargetEnum["TEAM_RIGHT_FRONT"] = 2] = "TEAM_RIGHT_FRONT";
17
+ CourtTargetEnum[CourtTargetEnum["TEAM_LEFT_BACK"] = 5] = "TEAM_LEFT_BACK";
18
+ CourtTargetEnum[CourtTargetEnum["TEAM_MIDDLE_BACK"] = 6] = "TEAM_MIDDLE_BACK";
19
+ CourtTargetEnum[CourtTargetEnum["TEAM_RIGHT_BACK"] = 1] = "TEAM_RIGHT_BACK";
20
+ })(CourtTargetEnum = exports.CourtTargetEnum || (exports.CourtTargetEnum = {}));
21
+ // eslint-disable-next-line @typescript-eslint/no-namespace
22
+ (function (CourtTargetEnum) {
23
+ function getTeamSide() {
24
+ return [CourtTargetEnum.TEAM_RIGHT_BACK, CourtTargetEnum.TEAM_RIGHT_FRONT, CourtTargetEnum.TEAM_MIDDLE_FRONT,
25
+ CourtTargetEnum.TEAM_LEFT_FRONT, CourtTargetEnum.TEAM_LEFT_BACK, CourtTargetEnum.TEAM_MIDDLE_BACK];
26
+ }
27
+ CourtTargetEnum.getTeamSide = getTeamSide;
28
+ function getOpponentSide() {
29
+ return [CourtTargetEnum.OPPONENT_RIGHT_BACK, CourtTargetEnum.OPPONENT_RIGHT_FRONT, CourtTargetEnum.OPPONENT_MIDDLE_FRONT,
30
+ CourtTargetEnum.OPPONENT_LEFT_FRONT, CourtTargetEnum.OPPONENT_LEFT_BACK, CourtTargetEnum.OPPONENT_MIDDLE_BACK];
31
+ }
32
+ CourtTargetEnum.getOpponentSide = getOpponentSide;
33
+ function getSidePosition(position) {
34
+ if (position < 1 || position > 12)
35
+ throw new Error('POSITION_INDEX_OUT_OF_BOUNDS');
36
+ if (position > 6)
37
+ return position - 6;
38
+ else
39
+ return position;
40
+ }
41
+ CourtTargetEnum.getSidePosition = getSidePosition;
42
+ })(CourtTargetEnum = exports.CourtTargetEnum || (exports.CourtTargetEnum = {}));
@@ -1,37 +1,37 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const globals_1 = require("@jest/globals");
4
- const court_target_1 = require("./court-target");
4
+ const court_target_enum_1 = require("./court-target-enum");
5
5
  (0, globals_1.describe)('CourtTarget Test Module', () => {
6
6
  // getSidePosition Tests
7
7
  (0, globals_1.test)('Should get correct court position', () => {
8
8
  for (let i = 1; i < 7; i++) {
9
- (0, globals_1.expect)(court_target_1.CourtTarget.getSidePosition(i)).toBe(i);
10
- (0, globals_1.expect)(court_target_1.CourtTarget.getSidePosition(i + 6)).toBe(i);
9
+ (0, globals_1.expect)(court_target_enum_1.CourtTargetEnum.getSidePosition(i)).toBe(i);
10
+ (0, globals_1.expect)(court_target_enum_1.CourtTargetEnum.getSidePosition(i + 6)).toBe(i);
11
11
  }
12
12
  });
13
13
  (0, globals_1.test)('Should throw Error when position is out of bounds', () => {
14
- function position() { court_target_1.CourtTarget.getSidePosition(0); }
14
+ function position() { court_target_enum_1.CourtTargetEnum.getSidePosition(0); }
15
15
  (0, globals_1.expect)(position).toThrow(/^POSITION_INDEX_OUT_OF_BOUNDS$/);
16
16
  });
17
17
  // getTeamSide Tests
18
18
  (0, globals_1.test)('Should return team positions', () => {
19
- const positions = court_target_1.CourtTarget.getTeamSide();
20
- (0, globals_1.expect)(positions[0]).toBe(court_target_1.CourtTarget.TEAM_RIGHT_BACK);
21
- (0, globals_1.expect)(positions[1]).toBe(court_target_1.CourtTarget.TEAM_RIGHT_FRONT);
22
- (0, globals_1.expect)(positions[2]).toBe(court_target_1.CourtTarget.TEAM_MIDDLE_FRONT);
23
- (0, globals_1.expect)(positions[3]).toBe(court_target_1.CourtTarget.TEAM_LEFT_FRONT);
24
- (0, globals_1.expect)(positions[4]).toBe(court_target_1.CourtTarget.TEAM_LEFT_BACK);
25
- (0, globals_1.expect)(positions[5]).toBe(court_target_1.CourtTarget.TEAM_MIDDLE_BACK);
19
+ const positions = court_target_enum_1.CourtTargetEnum.getTeamSide();
20
+ (0, globals_1.expect)(positions[0]).toBe(court_target_enum_1.CourtTargetEnum.TEAM_RIGHT_BACK);
21
+ (0, globals_1.expect)(positions[1]).toBe(court_target_enum_1.CourtTargetEnum.TEAM_RIGHT_FRONT);
22
+ (0, globals_1.expect)(positions[2]).toBe(court_target_enum_1.CourtTargetEnum.TEAM_MIDDLE_FRONT);
23
+ (0, globals_1.expect)(positions[3]).toBe(court_target_enum_1.CourtTargetEnum.TEAM_LEFT_FRONT);
24
+ (0, globals_1.expect)(positions[4]).toBe(court_target_enum_1.CourtTargetEnum.TEAM_LEFT_BACK);
25
+ (0, globals_1.expect)(positions[5]).toBe(court_target_enum_1.CourtTargetEnum.TEAM_MIDDLE_BACK);
26
26
  });
27
27
  // getOpponentSide Tests
28
28
  (0, globals_1.test)('Should return opponent team positions', () => {
29
- const positions = court_target_1.CourtTarget.getOpponentSide();
30
- (0, globals_1.expect)(positions[0]).toBe(court_target_1.CourtTarget.OPPONENT_RIGHT_BACK);
31
- (0, globals_1.expect)(positions[1]).toBe(court_target_1.CourtTarget.OPPONENT_RIGHT_FRONT);
32
- (0, globals_1.expect)(positions[2]).toBe(court_target_1.CourtTarget.OPPONENT_MIDDLE_FRONT);
33
- (0, globals_1.expect)(positions[3]).toBe(court_target_1.CourtTarget.OPPONENT_LEFT_FRONT);
34
- (0, globals_1.expect)(positions[4]).toBe(court_target_1.CourtTarget.OPPONENT_LEFT_BACK);
35
- (0, globals_1.expect)(positions[5]).toBe(court_target_1.CourtTarget.OPPONENT_MIDDLE_BACK);
29
+ const positions = court_target_enum_1.CourtTargetEnum.getOpponentSide();
30
+ (0, globals_1.expect)(positions[0]).toBe(court_target_enum_1.CourtTargetEnum.OPPONENT_RIGHT_BACK);
31
+ (0, globals_1.expect)(positions[1]).toBe(court_target_enum_1.CourtTargetEnum.OPPONENT_RIGHT_FRONT);
32
+ (0, globals_1.expect)(positions[2]).toBe(court_target_enum_1.CourtTargetEnum.OPPONENT_MIDDLE_FRONT);
33
+ (0, globals_1.expect)(positions[3]).toBe(court_target_enum_1.CourtTargetEnum.OPPONENT_LEFT_FRONT);
34
+ (0, globals_1.expect)(positions[4]).toBe(court_target_enum_1.CourtTargetEnum.OPPONENT_LEFT_BACK);
35
+ (0, globals_1.expect)(positions[5]).toBe(court_target_enum_1.CourtTargetEnum.OPPONENT_MIDDLE_BACK);
36
36
  });
37
37
  });
@@ -3,5 +3,5 @@ export * from './match-rating';
3
3
  export * from './match-set';
4
4
  export * from './rally';
5
5
  export * from './court-position';
6
- export * from './court-target';
6
+ export * from './court-target-enum';
7
7
  export * from './match-team';
@@ -19,5 +19,5 @@ __exportStar(require("./match-rating"), exports);
19
19
  __exportStar(require("./match-set"), exports);
20
20
  __exportStar(require("./rally"), exports);
21
21
  __exportStar(require("./court-position"), exports);
22
- __exportStar(require("./court-target"), exports);
22
+ __exportStar(require("./court-target-enum"), exports);
23
23
  __exportStar(require("./match-team"), exports);
@@ -36,7 +36,7 @@ class Rally {
36
36
  return this._state;
37
37
  }
38
38
  get score() {
39
- return this.events.find(e => e.eventType === rally_event_1.EventType.SCORE);
39
+ return this.events.find(e => e.eventType === rally_event_1.EventTypeEnum.SCORE);
40
40
  }
41
41
  isOver() {
42
42
  return this._state === RallyState.FINISHED;
@@ -46,7 +46,7 @@ const __stubs__2 = require("../team/__stubs__");
46
46
  (0, globals_1.test)('Should add event to event array', () => {
47
47
  (0, globals_1.expect)(rally.events.length).toBe(0);
48
48
  rally.addEvent(__stubs__1.serve);
49
- (0, globals_1.expect)(rally.events.at(-1)?.eventType).toBe(rally_event_1.EventType.SERVE);
49
+ (0, globals_1.expect)(rally.events.at(-1)?.eventType).toBe(rally_event_1.EventTypeEnum.SERVE);
50
50
  });
51
51
  // isOver Tests
52
52
  (0, globals_1.test)('Should return false if rally state is not FINISHED', () => {
@@ -68,7 +68,7 @@ const __stubs__2 = require("../team/__stubs__");
68
68
  (0, globals_1.test)('Should return Score if events array contains a Score', () => {
69
69
  rally.addEvent(__stubs__1.score);
70
70
  (0, globals_1.expect)(rally.score).not.toBeUndefined();
71
- (0, globals_1.expect)(rally.score?.eventType).toBe(rally_event_1.EventType.SCORE);
71
+ (0, globals_1.expect)(rally.score?.eventType).toBe(rally_event_1.EventTypeEnum.SCORE);
72
72
  });
73
73
  // RallyState Tests
74
74
  (0, globals_1.test)('Should get next state', () => {
@@ -1,6 +1,5 @@
1
1
  import { PerformanceStats } from './performance-stats';
2
2
  export declare class Role {
3
- readonly name: string;
4
3
  static readonly SETTER: Role;
5
4
  static readonly LIBERO: Role;
6
5
  static readonly OUTSIDE_HITTER: Role;
@@ -8,6 +7,7 @@ export declare class Role {
8
7
  static readonly MIDDLE_BLOCKER: Role;
9
8
  static readonly DEFENSIVE_SPECIALIST: Role;
10
9
  private static readonly ROLES;
10
+ readonly name: string;
11
11
  private constructor();
12
12
  static getRoles(): Role[];
13
13
  static calculateScore(stats: PerformanceStats, role: Role): number;
@@ -20,12 +20,12 @@ export declare class Team {
20
20
  readonly coach?: Coach;
21
21
  readonly league?: League;
22
22
  readonly country?: Country;
23
- private _rating;
24
23
  constructor({ id, rating, name, shortName, country, roster, coach, league }: TeamOpts);
25
- isPlayerInRoster(player: Player): boolean;
26
- toString(): string;
24
+ private _rating;
27
25
  get rating(): number;
28
26
  set rating(value: number);
27
+ isPlayerInRoster(player: Player): boolean;
28
+ toString(): string;
29
29
  updateRating(ratingChange: number): void;
30
30
  }
31
31
  export {};
@@ -15,18 +15,18 @@ class Team {
15
15
  this.country = country;
16
16
  this.league = league;
17
17
  }
18
- isPlayerInRoster(player) {
19
- return this.roster.some(p => p.id === player.id);
20
- }
21
- toString() {
22
- return `${this.name} [${this.shortName}] (${this.country?.name}) ELO=${this._rating}`;
23
- }
24
18
  get rating() {
25
19
  return this._rating;
26
20
  }
27
21
  set rating(value) {
28
22
  this._rating = value;
29
23
  }
24
+ isPlayerInRoster(player) {
25
+ return this.roster.some(p => p.id === player.id);
26
+ }
27
+ toString() {
28
+ return `${this.name} [${this.shortName}] (${this.country?.name}) ELO=${this._rating}`;
29
+ }
30
30
  updateRating(ratingChange) {
31
31
  if (Math.abs(ratingChange) > match_1.MatchRating.K)
32
32
  throw new Error(`INVALID RATING CHANGE: ${ratingChange}`);
@@ -1,19 +1,19 @@
1
- import { BlockFailure, BlockType, CourtTarget, EventType, LiberoReplacementType, ReceptionFailure, ReceptionType, ServeFailure, ServeType, SetFailure, SetType, SpikeFailure, SpikeType } from '../service';
1
+ import { BlockFailureEnum, BlockTypeEnum, CourtTargetEnum, EventTypeEnum, LiberoReplacementTypeEnum, ReceptionFailureEnum, ReceptionTypeEnum, ServeFailureEnum, ServeTypeEnum, SetFailureEnum, SetTypeEnum, SpikeFailureEnum, SpikeTypeEnum } from '../service';
2
2
  export interface APIEvent {
3
3
  readonly id: string;
4
4
  readonly order: number;
5
5
  readonly playerId: string;
6
- readonly eventType: EventType;
6
+ readonly eventType: EventTypeEnum;
7
7
  }
8
8
  export interface APILiberoReplacement extends APIEvent {
9
- readonly type: LiberoReplacementType;
9
+ readonly type: LiberoReplacementTypeEnum;
10
10
  readonly liberoId: string;
11
11
  }
12
12
  export interface APISubstitution extends APIEvent {
13
13
  readonly playerOutId: string;
14
14
  }
15
15
  export interface APIInPlayEvent extends APIEvent {
16
- readonly target: CourtTarget;
16
+ readonly target: CourtTargetEnum;
17
17
  readonly modifier: number;
18
18
  readonly score: number;
19
19
  }
@@ -21,23 +21,23 @@ export interface APIScore extends APIEvent {
21
21
  readonly teamId: string;
22
22
  }
23
23
  export interface APIServe extends APIInPlayEvent {
24
- readonly type: ServeType;
25
- readonly failure: ServeFailure;
24
+ readonly type: ServeTypeEnum;
25
+ readonly failure: ServeFailureEnum;
26
26
  }
27
27
  export interface APISet extends APIInPlayEvent {
28
- readonly type: SetType;
29
- readonly failure: SetFailure;
28
+ readonly type: SetTypeEnum;
29
+ readonly failure: SetFailureEnum;
30
30
  }
31
31
  export interface APISpike extends APIInPlayEvent {
32
- readonly failure: SpikeFailure;
33
- readonly type: SpikeType;
32
+ readonly failure: SpikeFailureEnum;
33
+ readonly type: SpikeTypeEnum;
34
34
  }
35
35
  export interface APIReception extends APIInPlayEvent {
36
- readonly type: ReceptionType;
37
- readonly failure: ReceptionFailure;
36
+ readonly type: ReceptionTypeEnum;
37
+ readonly failure: ReceptionFailureEnum;
38
38
  }
39
39
  export interface APIBlock extends APIInPlayEvent {
40
- readonly failure: BlockFailure;
41
- readonly type: BlockType;
40
+ readonly failure: BlockFailureEnum;
41
+ readonly type: BlockTypeEnum;
42
42
  readonly blockers: string[];
43
43
  }
@@ -1,8 +1,7 @@
1
- import { APIBlock, APIEvent, APIInPlayEvent, APILiberoReplacement, APIReception, APIScore, APIServe, APISet, APISpike, APISubstitution } from './events';
2
- import { APILeague, APISeason } from './league';
3
- import { APIMatch, APIMatchSet, APIRally, APISetStatistics } from './match';
4
- import { APIPlayer, APITrait } from './player';
5
- import { APITeam } from './team';
6
- import { APICoach } from './coach';
7
- import { APITournament, APITournamentMatch } from './tournament';
8
- export { APICoach, APITeam, APIReception, APIScore, APIServe, APISet, APISpike, APISubstitution, APIMatchSet, APISetStatistics, APIInPlayEvent, APILeague, APIMatch, APIPlayer, APISeason, APIEvent, APILiberoReplacement, APIBlock, APITrait, APIRally, APITournament, APITournamentMatch };
1
+ export * from './events';
2
+ export * from './league';
3
+ export * from './match';
4
+ export * from './player';
5
+ export * from './team';
6
+ export * from './coach';
7
+ export * from './tournament';
@@ -1,2 +1,7 @@
1
- import { APITrait } from './player';
2
- export { APITrait };
1
+ export * from './events';
2
+ export * from './league';
3
+ export * from './match';
4
+ export * from './player';
5
+ export * from './team';
6
+ export * from './coach';
7
+ export * from './tournament';
@@ -1,6 +1,3 @@
1
- import type { MatchRatingCreationAttributes, MatchRatingId, MatchRatingPk, DraftPk, DraftId, DraftCreationAttributes, DraftPickCreationAttributes, DraftPickId, DraftPickPk, PlayerTeamCreationAttributes, PlayerTeamId, PlayerTeamOptionalAttributes, PlayerTeamPk, BlockCreationAttributes, BlockFailure, BlockId, BlockPk, BlockType, CoachCreationAttributes, CoachId, CoachPk, CountryCreationAttributes, CountryId, CountryPk, CourtPositionType, CourtTarget, EventCreationAttributes, EventId, EventPk, EventType, FormationType, LeagueCreationAttributes, LeagueId, LeaguePk, LiberoReplacementCreationAttributes, LiberoReplacementId, LiberoReplacementPk, LiberoReplacementType, MatchCreationAttributes, MatchId, MatchPk, MatchSetCreationAttributes, MatchSetId, MatchSetPk, MatchSetStatsCreationAttributes, MatchSetStatsId, MatchSetStatsPk, PerformanceStatsCreationAttributes, PerformanceStatsId, PerformanceStatsPk, PlayerCreationAttributes, PlayerId, PlayerPk, RallyCreationAttributes, RallyId, RallyPk, RallyPositionCreationAttributes, RallyPositionId, RallyPositionPk, ReceptionCreationAttributes, ReceptionFailure, ReceptionId, ReceptionPk, ReceptionType, RoleType, ScoreCreationAttributes, ScoreId, ScorePk, SeasonCreationAttributes, SeasonId, SeasonMatchCreationAttributes, SeasonMatchId, SeasonMatchPk, SeasonPk, SeasonTeamsCreationAttributes, SeasonTeamsId, SeasonTeamsPk, ServeCreationAttributes, ServeFailure, ServeId, ServePk, ServeType, SetCreationAttributes, SetFailure, SetId, SetPk, SetType, Side, SpikeCreationAttributes, SpikeFailure, SpikeId, SpikePk, SpikeType, SubstitutionCreationAttributes, SubstitutionId, SubstitutionPk, TeamCreationAttributes, TeamId, TeamPk, TournamentCreationAttributes, TournamentId, TournamentMatchCreationAttributes, TournamentMatchId, TournamentMatchPk, TournamentPk, TournamentStage, TournamentTeamsCreationAttributes, TournamentTeamsId, TournamentTeamsPk, TraitType, IterationPk, IterationCreationAttributes, IterationId, UserCreationAttributes, UserOptionalAttributes, UserRole, UserId, UserPk } from './models';
2
- import { UserAttributes, UserModel, MatchRatingModel, MatchRatingAttributes, DraftModel, DraftAttributes, DraftPickAttributes, DraftPickModel, PlayerTeamModel, PlayerTeamAttributes, BlockAttributes, BlockModel, BlockOptionalAttributes, CoachAttributes, CoachModel, CoachOptionalAttributes, CountryAttributes, CountryModel, EventAttributes, EventModel, LeagueAttributes, LeagueModel, LiberoReplacementAttributes, LiberoReplacementModel, MatchAttributes, MatchModel, MatchSetAttributes, MatchSetModel, MatchSetOptionalAttributes, MatchSetStatsAttributes, MatchSetStatsModel, MatchSetStatsOptionalAttributes, PerformanceStatsAttributes, PerformanceStatsModel, PerformanceStatsOptionalAttributes, PlayerAttributes, PlayerModel, RallyAttributes, RallyModel, RallyPositionAttributes, RallyPositionModel, ReceptionAttributes, ReceptionModel, ScoreAttributes, ScoreModel, SeasonAttributes, SeasonMatchAttributes, SeasonMatchModel, SeasonModel, SeasonTeamsAttributes, SeasonTeamsModel, ServeAttributes, ServeModel, SetAttributes, SetModel, SpikeAttributes, SpikeModel, SubstitutionAttributes, SubstitutionModel, TeamAttributes, TeamModel, TournamentAttributes, TournamentMatchAttributes, TournamentMatchModel, TournamentModel, TournamentOptionalAttributes, TournamentTeamsAttributes, TournamentTeamsModel, IterationModel, IterationAttributes } from './models';
3
- import { transformFromBlock, transformFromCoach, transformFromCountry, transformFromCourtPosition, transformFromCourtTarget, transformFromEventType, transformFromFormation, transformFromLeague, transformFromLiberoReplacement, transformFromMatch, transformFromMatchSet, transformFromMatchSetStats, transformFromPerformanceStats, transformFromPlayer, transformFromPlayerPosition, transformFromRally, transformFromReception, transformFromRole, transformFromScore, transformFromSeason, transformFromSeasonMatch, transformFromServe, transformFromSet, transformFromSpike, transformFromStage, transformFromSubstitution, transformFromTeam, transformFromTournament, transformFromTournamentMatch, transformFromTrait, transformToAPIBlock, transformToAPICoach, transformToAPILeague, transformToAPILiberoReplacement, transformToAPIMatch, transformToAPIMatchSet, transformToAPIMatchSetStats, transformToAPIPlayer, transformToAPIRally, transformToAPIReception, transformToAPIScore, transformToAPISeason, transformToAPIServe, transformToAPISet, transformToAPISpike, transformToAPISubstitution, transformToAPITeam, transformToAPITournament, transformToAPITournamentMatch, transformToAPITrait, transformToBlock, transformToCoach, transformToCountry, transformToCourtPosition, transformToCourtTarget, transformToEventType, transformToFormation, transformToLeague, transformToLiberoReplacement, transformToMatch, transformToMatchSet, transformToMatchSetStats, transformToPerformanceStats, transformToPlayer, transformToPlayerPosition, transformToRally, transformToReception, transformToRole, transformToScore, transformToSeason, transformToServe, transformToSet, transformToSpike, transformToStage, transformToSubstitution, transformToTeam, transformToTournament, transformToTournamentMatch, transformToTrait, transformToIteration, transformFromIteration, transformFromPlayerTeam, transformFromMatchRating, transformFromDraft, transformToDraft, transformFromDraftPick, transformToDraftPick } from './transformers';
4
- import { initModels } from './init-models';
5
- export { initModels, transformToStage, transformFromDraft, transformToDraft, transformFromDraftPick, transformToDraftPick, transformFromStage, transformFromPlayerTeam, transformFromMatchRating, MatchRatingModel, MatchRatingAttributes, DraftModel, DraftAttributes, DraftPickAttributes, DraftPickModel, PlayerTeamModel, PlayerTeamAttributes, SeasonMatchModel, SeasonMatchAttributes, TournamentAttributes, TournamentModel, TournamentMatchAttributes, TournamentMatchModel, BlockAttributes, BlockModel, BlockOptionalAttributes, CoachAttributes, CoachModel, CoachOptionalAttributes, CountryAttributes, CountryModel, EventAttributes, EventModel, LeagueAttributes, LeagueModel, LiberoReplacementAttributes, LiberoReplacementModel, MatchAttributes, MatchModel, MatchSetAttributes, MatchSetModel, MatchSetOptionalAttributes, MatchSetStatsAttributes, MatchSetStatsModel, MatchSetStatsOptionalAttributes, PerformanceStatsAttributes, PerformanceStatsModel, PerformanceStatsOptionalAttributes, PlayerAttributes, PlayerModel, RallyAttributes, RallyModel, RallyPositionAttributes, RallyPositionModel, ReceptionAttributes, ReceptionModel, ScoreAttributes, ScoreModel, SeasonAttributes, SeasonModel, SeasonTeamsAttributes, SeasonTeamsModel, ServeAttributes, ServeModel, SetAttributes, SetModel, SpikeAttributes, SpikeModel, SubstitutionAttributes, SubstitutionModel, TeamAttributes, TeamModel, UserAttributes, UserModel, transformFromBlock, transformFromCoach, transformFromCountry, transformFromCourtPosition, transformFromCourtTarget, transformFromEventType, transformFromFormation, transformFromLeague, transformFromLiberoReplacement, transformFromMatch, transformFromMatchSet, transformFromMatchSetStats, transformFromPerformanceStats, transformFromPlayer, transformFromPlayerPosition, transformFromRally, transformFromReception, transformFromRole, transformFromScore, transformFromSeason, transformFromServe, transformFromSet, transformFromSpike, transformFromSubstitution, transformFromTeam, transformFromTrait, transformToAPIBlock, transformFromSeasonMatch, transformToAPILiberoReplacement, transformToAPIMatch, transformToAPIMatchSet, transformToAPIMatchSetStats, transformToAPIPlayer, transformToAPIRally, transformToAPIReception, transformToAPIScore, transformToAPISeason, transformToAPIServe, transformToAPISet, transformToAPISpike, transformToAPILeague, transformToAPISubstitution, transformToAPITeam, transformToAPITrait, transformToBlock, transformToCoach, transformToCountry, transformToCourtPosition, transformToCourtTarget, transformToEventType, transformToFormation, transformToLeague, transformToLiberoReplacement, transformToAPICoach, transformToMatch, transformToMatchSet, transformToMatchSetStats, transformToPerformanceStats, transformToPlayer, transformToPlayerPosition, transformToRally, transformToReception, transformToRole, transformToScore, transformToSeason, transformToServe, transformToSet, transformToSpike, transformToSubstitution, transformToTeam, transformToTrait, transformFromTournament, transformToAPITournament, transformToTournament, transformFromTournamentMatch, transformToAPITournamentMatch, transformToTournamentMatch, transformToIteration, transformFromIteration, TournamentTeamsAttributes, TournamentTeamsModel, IterationModel, IterationAttributes, };
6
- export type { UserCreationAttributes, UserOptionalAttributes, UserRole, UserId, UserPk, MatchRatingCreationAttributes, MatchRatingId, MatchRatingPk, DraftPk, DraftId, DraftCreationAttributes, DraftPickCreationAttributes, DraftPickId, DraftPickPk, PlayerTeamCreationAttributes, PlayerTeamId, PlayerTeamOptionalAttributes, PlayerTeamPk, TournamentOptionalAttributes, TournamentId, TournamentPk, TournamentMatchId, TournamentMatchPk, TournamentStage, BlockId, BlockPk, CoachId, CoachPk, CountryId, CountryPk, SeasonMatchId, SeasonMatchPk, EventId, EventPk, LeagueId, LeaguePk, LiberoReplacementId, LiberoReplacementPk, MatchId, MatchPk, MatchSetId, MatchSetPk, MatchSetStatsId, MatchSetStatsPk, PerformanceStatsId, PerformanceStatsPk, PlayerId, PlayerPk, RallyId, RallyPk, RallyPositionId, RallyPositionPk, ReceptionId, ReceptionPk, RoleType, ScoreId, ScorePk, SeasonId, SeasonPk, SeasonTeamsId, SeasonTeamsPk, ServeId, ServePk, SetId, SetPk, SpikeId, SpikePk, SubstitutionId, SubstitutionPk, TeamId, TeamPk, TraitType, EventType, BlockFailure, BlockType, FormationType, ServeFailure, SpikeFailure, SpikeType, SetType, ReceptionFailure, SetFailure, ServeType, ReceptionType, CourtPositionType, Side, CourtTarget, LiberoReplacementType, TournamentTeamsId, TournamentTeamsPk, TournamentCreationAttributes, TournamentMatchCreationAttributes, BlockCreationAttributes, CoachCreationAttributes, CountryCreationAttributes, SeasonMatchCreationAttributes, EventCreationAttributes, LeagueCreationAttributes, LiberoReplacementCreationAttributes, MatchCreationAttributes, MatchSetCreationAttributes, MatchSetStatsCreationAttributes, PerformanceStatsCreationAttributes, PlayerCreationAttributes, RallyCreationAttributes, RallyPositionCreationAttributes, ReceptionCreationAttributes, ScoreCreationAttributes, SeasonCreationAttributes, SeasonTeamsCreationAttributes, ServeCreationAttributes, SetCreationAttributes, SpikeCreationAttributes, SubstitutionCreationAttributes, TeamCreationAttributes, TournamentTeamsCreationAttributes, IterationCreationAttributes, IterationId, IterationPk };
1
+ export * from './models';
2
+ export * from './transformers';
3
+ export { initModels } from './init-models';
@@ -1,4 +1,3 @@
1
- import { UserModel, MatchRatingModel, DraftModel, DraftPickModel, PlayerTeamModel, BlockModel, CoachModel, CountryModel, EventModel, LeagueModel, LiberoReplacementModel, MatchModel, MatchSetModel, MatchSetStatsModel, PerformanceStatsModel, PlayerModel, RallyModel, RallyPositionModel, ReceptionModel, ScoreModel, SeasonMatchModel, SeasonModel, SeasonTeamsModel, ServeModel, SetModel, SpikeModel, SubstitutionModel, TeamModel, TournamentMatchModel, TournamentModel, TournamentTeamsModel, IterationModel } from './models';
2
- import { transformFromBlock, transformFromCoach, transformFromCountry, transformFromCourtPosition, transformFromCourtTarget, transformFromEventType, transformFromFormation, transformFromLeague, transformFromLiberoReplacement, transformFromMatch, transformFromMatchSet, transformFromMatchSetStats, transformFromPerformanceStats, transformFromPlayer, transformFromPlayerPosition, transformFromRally, transformFromReception, transformFromRole, transformFromScore, transformFromSeason, transformFromSeasonMatch, transformFromServe, transformFromSet, transformFromSpike, transformFromStage, transformFromSubstitution, transformFromTeam, transformFromTournament, transformFromTournamentMatch, transformFromTrait, transformToAPIBlock, transformToAPICoach, transformToAPILeague, transformToAPILiberoReplacement, transformToAPIMatch, transformToAPIMatchSet, transformToAPIMatchSetStats, transformToAPIPlayer, transformToAPIRally, transformToAPIReception, transformToAPIScore, transformToAPISeason, transformToAPIServe, transformToAPISet, transformToAPISpike, transformToAPISubstitution, transformToAPITeam, transformToAPITournament, transformToAPITournamentMatch, transformToAPITrait, transformToBlock, transformToCoach, transformToCountry, transformToCourtPosition, transformToCourtTarget, transformToEventType, transformToFormation, transformToLeague, transformToLiberoReplacement, transformToMatch, transformToMatchSet, transformToMatchSetStats, transformToPerformanceStats, transformToPlayer, transformToPlayerPosition, transformToRally, transformToReception, transformToRole, transformToScore, transformToSeason, transformToServe, transformToSet, transformToSpike, transformToStage, transformToSubstitution, transformToTeam, transformToTournament, transformToTournamentMatch, transformToTrait, transformToIteration, transformFromIteration, transformFromPlayerTeam, transformFromMatchRating, transformFromDraft, transformToDraft, transformFromDraftPick, transformToDraftPick, } from './transformers';
3
- import { initModels } from './init-models';
4
- export { initModels, transformToStage, transformFromDraft, transformToDraft, transformFromDraftPick, transformToDraftPick, transformFromStage, transformFromPlayerTeam, transformFromMatchRating, MatchRatingModel, DraftModel, DraftPickModel, PlayerTeamModel, SeasonMatchModel, TournamentModel, TournamentMatchModel, BlockModel, CoachModel, CountryModel, EventModel, LeagueModel, LiberoReplacementModel, MatchModel, MatchSetModel, MatchSetStatsModel, PerformanceStatsModel, PlayerModel, RallyModel, RallyPositionModel, ReceptionModel, ScoreModel, SeasonModel, SeasonTeamsModel, ServeModel, SetModel, SpikeModel, SubstitutionModel, TeamModel, UserModel, transformFromBlock, transformFromCoach, transformFromCountry, transformFromCourtPosition, transformFromCourtTarget, transformFromEventType, transformFromFormation, transformFromLeague, transformFromLiberoReplacement, transformFromMatch, transformFromMatchSet, transformFromMatchSetStats, transformFromPerformanceStats, transformFromPlayer, transformFromPlayerPosition, transformFromRally, transformFromReception, transformFromRole, transformFromScore, transformFromSeason, transformFromServe, transformFromSet, transformFromSpike, transformFromSubstitution, transformFromTeam, transformFromTrait, transformToAPIBlock, transformFromSeasonMatch, transformToAPILiberoReplacement, transformToAPIMatch, transformToAPIMatchSet, transformToAPIMatchSetStats, transformToAPIPlayer, transformToAPIRally, transformToAPIReception, transformToAPIScore, transformToAPISeason, transformToAPIServe, transformToAPISet, transformToAPISpike, transformToAPILeague, transformToAPISubstitution, transformToAPITeam, transformToAPITrait, transformToBlock, transformToCoach, transformToCountry, transformToCourtPosition, transformToCourtTarget, transformToEventType, transformToFormation, transformToLeague, transformToLiberoReplacement, transformToAPICoach, transformToMatch, transformToMatchSet, transformToMatchSetStats, transformToPerformanceStats, transformToPlayer, transformToPlayerPosition, transformToRally, transformToReception, transformToRole, transformToScore, transformToSeason, transformToServe, transformToSet, transformToSpike, transformToSubstitution, transformToTeam, transformToTrait, transformFromTournament, transformToAPITournament, transformToTournament, transformFromTournamentMatch, transformToAPITournamentMatch, transformToTournamentMatch, transformToIteration, transformFromIteration, TournamentTeamsModel, IterationModel, };
1
+ export * from './models';
2
+ export * from './transformers';
3
+ export { initModels } from './init-models';
@@ -1,6 +1,6 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model, Optional } from 'sequelize';
3
- import type { CourtTarget, EventType, PlayerId, PlayerModel, RallyId, RallyModel } from '.';
3
+ import { CourtTarget, EventType, PlayerId, PlayerModel, RallyId, RallyModel, TraitType } from '.';
4
4
  export interface BlockAttributes {
5
5
  event_id: string;
6
6
  rally_id: string;
@@ -15,6 +15,7 @@ export interface BlockAttributes {
15
15
  blocker_3?: string;
16
16
  modifier: number;
17
17
  score: number;
18
+ active_traits: TraitType[];
18
19
  }
19
20
  export type BlockType = 'NO_BLOCKER' | 'SINGLE' | 'DOUBLE' | 'TRIPLE';
20
21
  export type BlockFailure = 'NO_FAILURE' | 'FAULT' | 'MISS' | 'OUT_OF_BOUNDS' | 'WIPE' | 'TOOL';
@@ -36,6 +37,7 @@ export declare class BlockModel extends Model<BlockAttributes, BlockCreationAttr
36
37
  blocker_3?: string;
37
38
  modifier: number;
38
39
  score: number;
40
+ active_traits: TraitType[];
39
41
  player: PlayerModel;
40
42
  getPlayer: Sequelize.BelongsToGetAssociationMixin<PlayerModel>;
41
43
  setPlayer: Sequelize.BelongsToSetAssociationMixin<PlayerModel, PlayerId>;
@@ -74,21 +74,22 @@ export class BlockModel extends Model {
74
74
  score: {
75
75
  type: DataTypes.REAL,
76
76
  allowNull: false
77
+ },
78
+ active_traits: {
79
+ type: DataTypes.ARRAY(DataTypes.ENUM('MARKSMAN', 'MOVING_WALL', 'MASTER_MIND', 'METEOR_SERVE', 'VIGOROUS', 'GUARDIAN')),
80
+ allowNull: false,
81
+ defaultValue: [[]]
77
82
  }
78
83
  }, {
79
84
  sequelize,
80
85
  tableName: 'Block',
81
86
  schema: 'public',
82
87
  timestamps: false,
83
- indexes: [
84
- {
88
+ indexes: [{
85
89
  name: 'Block_pk',
86
90
  unique: true,
87
- fields: [
88
- { name: 'event_id' }
89
- ]
90
- }
91
- ]
91
+ fields: [{ name: 'event_id' }]
92
+ }]
92
93
  });
93
94
  }
94
95
  }
@@ -1,12 +1,13 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model } from 'sequelize';
3
- import type { PlayerId, PlayerModel, RallyId, RallyModel } from '.';
3
+ import { PlayerId, PlayerModel, RallyId, RallyModel, TraitType } from '.';
4
4
  export interface EventAttributes {
5
5
  event_id: string;
6
6
  rally_id: string;
7
7
  event_type: EventType;
8
8
  order: number;
9
9
  player_id: string;
10
+ active_traits: TraitType[];
10
11
  }
11
12
  export type EventType = 'LIBERO_REPLACEMENT' | 'SUBSTITUTION' | 'SERVE' | 'RECEPTION' | 'SET' | 'SPIKE' | 'BLOCK' | 'SCORE';
12
13
  export type CourtTarget = 'NO_TARGET' | 'OPPONENT_RIGHT_BACK' | 'OPPONENT_MIDDLE_BACK' | 'OPPONENT_LEFT_BACK' | 'OPPONENT_RIGHT_FRONT' | 'OPPONENT_MIDDLE_FRONT' | 'OPPONENT_LEFT_FRONT' | 'TEAM_LEFT_FRONT' | 'TEAM_MIDDLE_FRONT' | 'TEAM_RIGHT_FRONT' | 'TEAM_LEFT_BACK' | 'TEAM_MIDDLE_BACK' | 'TEAM_RIGHT_BACK';
@@ -19,6 +20,7 @@ export declare class EventModel extends Model<EventAttributes, EventCreationAttr
19
20
  event_type: EventType;
20
21
  order: number;
21
22
  player_id: string;
23
+ active_traits: TraitType[];
22
24
  player: PlayerModel;
23
25
  getPlayer: Sequelize.BelongsToGetAssociationMixin<PlayerModel>;
24
26
  setPlayer: Sequelize.BelongsToSetAssociationMixin<PlayerModel, PlayerId>;
@@ -30,21 +30,22 @@ export class EventModel extends Model {
30
30
  model: 'Player',
31
31
  key: 'player_id'
32
32
  }
33
+ },
34
+ active_traits: {
35
+ type: DataTypes.ARRAY(DataTypes.ENUM('MARKSMAN', 'MOVING_WALL', 'MASTER_MIND', 'METEOR_SERVE', 'VIGOROUS', 'GUARDIAN')),
36
+ allowNull: false,
37
+ defaultValue: [[]]
33
38
  }
34
39
  }, {
35
40
  sequelize,
36
41
  tableName: 'Event',
37
42
  schema: 'public',
38
43
  timestamps: false,
39
- indexes: [
40
- {
44
+ indexes: [{
41
45
  name: 'Event_pk',
42
46
  unique: true,
43
- fields: [
44
- { name: 'event_id' }
45
- ]
46
- }
47
- ]
47
+ fields: [{ name: 'event_id' }]
48
+ }]
48
49
  });
49
50
  }
50
51
  }
@@ -1,64 +1,32 @@
1
- import type { BlockCreationAttributes, BlockFailure, BlockId, BlockOptionalAttributes, BlockPk, BlockType } from './block';
2
- import { BlockAttributes, BlockModel } from './block';
3
- import type { CoachCreationAttributes, CoachId, CoachOptionalAttributes, CoachPk, FormationType } from './coach';
4
- import { CoachAttributes, CoachModel } from './coach';
5
- import type { CountryCreationAttributes, CountryId, CountryPk } from './country';
6
- import { CountryAttributes, CountryModel } from './country';
7
- import type { DraftCreationAttributes, DraftId, DraftPk } from './draft';
8
- import { DraftAttributes, DraftModel } from './draft';
9
- import type { DraftPickCreationAttributes, DraftPickId, DraftPickPk } from './draft-pick';
10
- import { DraftPickAttributes, DraftPickModel } from './draft-pick';
11
- import type { PlayerTeamCreationAttributes, PlayerTeamId, PlayerTeamOptionalAttributes, PlayerTeamPk } from './player-team';
12
- import { PlayerTeamAttributes, PlayerTeamModel } from './player-team';
13
- import type { CourtTarget, EventCreationAttributes, EventId, EventPk, EventType } from './event';
14
- import { EventAttributes, EventModel } from './event';
15
- import type { IterationCreationAttributes, IterationId, IterationPk } from './iteration';
16
- import { IterationAttributes, IterationModel } from './iteration';
17
- import type { LeagueCreationAttributes, LeagueId, LeaguePk } from './league';
18
- import { LeagueAttributes, LeagueModel } from './league';
19
- import type { LiberoReplacementCreationAttributes, LiberoReplacementId, LiberoReplacementPk, LiberoReplacementType } from './libero-replacement';
20
- import { LiberoReplacementAttributes, LiberoReplacementModel } from './libero-replacement';
21
- import type { MatchCreationAttributes, MatchId, MatchPk } from './match';
22
- import { MatchAttributes, MatchModel } from './match';
23
- import type { MatchSetCreationAttributes, MatchSetId, MatchSetOptionalAttributes, MatchSetPk } from './match-set';
24
- import { MatchSetAttributes, MatchSetModel } from './match-set';
25
- import type { MatchSetStatsCreationAttributes, MatchSetStatsId, MatchSetStatsOptionalAttributes, MatchSetStatsPk } from './match-set-stats';
26
- import { MatchSetStatsAttributes, MatchSetStatsModel } from './match-set-stats';
27
- import type { PerformanceStatsCreationAttributes, PerformanceStatsId, PerformanceStatsOptionalAttributes, PerformanceStatsPk } from './performance-stats';
28
- import { PerformanceStatsAttributes, PerformanceStatsModel } from './performance-stats';
29
- import type { PlayerCreationAttributes, PlayerId, PlayerPk, RoleType, TraitType } from './player';
30
- import { PlayerAttributes, PlayerModel } from './player';
31
- import { RallyAttributes, RallyCreationAttributes, RallyId, RallyModel, RallyPk } from './rally';
32
- import { CourtPositionType, RallyPositionAttributes, RallyPositionCreationAttributes, RallyPositionId, RallyPositionModel, RallyPositionPk, Side } from './rally-position';
33
- import type { ReceptionCreationAttributes, ReceptionFailure, ReceptionId, ReceptionPk, ReceptionType } from './reception';
34
- import { ReceptionAttributes, ReceptionModel } from './reception';
35
- import type { ScoreCreationAttributes, ScoreId, ScorePk } from './score';
36
- import { ScoreAttributes, ScoreModel } from './score';
37
- import type { SeasonCreationAttributes, SeasonId, SeasonPk } from './season';
38
- import { SeasonAttributes, SeasonModel } from './season';
39
- import type { SeasonTeamsCreationAttributes, SeasonTeamsId, SeasonTeamsPk } from './season-teams';
40
- import { SeasonTeamsAttributes, SeasonTeamsModel } from './season-teams';
41
- import type { SeasonMatchCreationAttributes, SeasonMatchId, SeasonMatchPk } from './season-match';
42
- import { SeasonMatchAttributes, SeasonMatchModel } from './season-match';
43
- import type { ServeCreationAttributes, ServeFailure, ServeId, ServePk, ServeType } from './serve';
44
- import { ServeAttributes, ServeModel } from './serve';
45
- import type { SetCreationAttributes, SetFailure, SetId, SetPk, SetType } from './set';
46
- import { SetAttributes, SetModel } from './set';
47
- import type { SpikeCreationAttributes, SpikeFailure, SpikeId, SpikePk, SpikeType } from './spike';
48
- import { SpikeAttributes, SpikeModel } from './spike';
49
- import type { SubstitutionCreationAttributes, SubstitutionId, SubstitutionPk } from './substitution';
50
- import { SubstitutionAttributes, SubstitutionModel } from './substitution';
51
- import type { TeamCreationAttributes, TeamId, TeamPk } from './team';
52
- import { TeamAttributes, TeamModel } from './team';
53
- import type { TournamentCreationAttributes, TournamentId, TournamentOptionalAttributes, TournamentPk } from './tournament';
54
- import { TournamentAttributes, TournamentModel } from './tournament';
55
- import type { TournamentMatchCreationAttributes, TournamentMatchId, TournamentMatchPk, TournamentStage } from './tournament-match';
56
- import { TournamentMatchAttributes, TournamentMatchModel } from './tournament-match';
57
- import type { TournamentTeamsCreationAttributes, TournamentTeamsId, TournamentTeamsPk } from './tournament-teams';
58
- import { TournamentTeamsAttributes, TournamentTeamsModel } from './tournament-teams';
59
- import type { MatchRatingCreationAttributes, MatchRatingId, MatchRatingPk } from './match-rating';
60
- import { MatchRatingAttributes, MatchRatingModel } from './match-rating';
61
- import type { UserCreationAttributes, UserId, UserOptionalAttributes, UserPk, UserRole } from './user';
62
- import { UserAttributes, UserModel } from './user';
63
- export type { MatchRatingCreationAttributes, MatchRatingId, MatchRatingPk, DraftPk, DraftId, DraftCreationAttributes, DraftPickCreationAttributes, DraftPickId, DraftPickPk, PlayerTeamCreationAttributes, PlayerTeamId, PlayerTeamOptionalAttributes, PlayerTeamPk, TournamentId, TournamentPk, TournamentMatchId, TournamentMatchPk, TournamentStage, BlockId, BlockPk, CoachId, CoachPk, CountryId, CountryPk, SeasonMatchId, SeasonMatchPk, EventId, EventPk, LeagueId, LeaguePk, LiberoReplacementId, LiberoReplacementPk, MatchId, MatchPk, MatchSetId, MatchSetPk, MatchSetStatsId, MatchSetStatsPk, PerformanceStatsId, PerformanceStatsPk, PlayerId, PlayerPk, RallyId, RallyPk, RallyPositionId, RallyPositionPk, ReceptionId, ReceptionPk, RoleType, ScoreId, ScorePk, SeasonId, SeasonPk, SeasonTeamsId, SeasonTeamsPk, ServeId, ServePk, SetId, SetPk, SpikeId, SpikePk, SubstitutionId, SubstitutionPk, TeamId, TeamPk, TraitType, EventType, BlockFailure, BlockType, FormationType, ServeFailure, SpikeFailure, SpikeType, SetType, ReceptionFailure, SetFailure, ServeType, ReceptionType, CourtPositionType, Side, CourtTarget, LiberoReplacementType, TournamentTeamsId, TournamentTeamsPk, TournamentCreationAttributes, TournamentMatchCreationAttributes, BlockCreationAttributes, CoachCreationAttributes, CountryCreationAttributes, SeasonMatchCreationAttributes, EventCreationAttributes, LeagueCreationAttributes, LiberoReplacementCreationAttributes, MatchCreationAttributes, MatchSetCreationAttributes, MatchSetStatsCreationAttributes, PerformanceStatsCreationAttributes, PlayerCreationAttributes, RallyCreationAttributes, RallyPositionCreationAttributes, ReceptionCreationAttributes, ScoreCreationAttributes, SeasonCreationAttributes, SeasonTeamsCreationAttributes, ServeCreationAttributes, SetCreationAttributes, SpikeCreationAttributes, SubstitutionCreationAttributes, TeamCreationAttributes, TournamentTeamsCreationAttributes, IterationPk, IterationId, IterationCreationAttributes, UserCreationAttributes, UserOptionalAttributes, UserRole, UserId, UserPk };
64
- export { UserAttributes, UserModel, MatchRatingModel, MatchRatingAttributes, DraftModel, DraftAttributes, DraftPickAttributes, DraftPickModel, PlayerTeamModel, PlayerTeamAttributes, TournamentAttributes, TournamentMatchAttributes, BlockAttributes, BlockOptionalAttributes, CoachAttributes, CoachOptionalAttributes, CountryAttributes, SeasonMatchAttributes, EventAttributes, LeagueAttributes, LiberoReplacementAttributes, MatchAttributes, MatchSetAttributes, MatchSetOptionalAttributes, MatchSetStatsAttributes, MatchSetStatsOptionalAttributes, PerformanceStatsAttributes, PerformanceStatsOptionalAttributes, PlayerAttributes, RallyAttributes, RallyPositionAttributes, ReceptionAttributes, ScoreAttributes, SeasonAttributes, SeasonTeamsAttributes, ServeAttributes, SetAttributes, SpikeAttributes, SubstitutionAttributes, TeamAttributes, TournamentOptionalAttributes, TournamentTeamsAttributes, TournamentModel, TournamentMatchModel, BlockModel, CoachModel, CountryModel, SeasonMatchModel, EventModel, LeagueModel, LiberoReplacementModel, MatchModel, MatchSetModel, MatchSetStatsModel, PerformanceStatsModel, PlayerModel, RallyModel, RallyPositionModel, ReceptionModel, ScoreModel, SeasonModel, SeasonTeamsModel, ServeModel, SetModel, SpikeModel, SubstitutionModel, TeamModel, TournamentTeamsModel, IterationAttributes, IterationModel };
1
+ export * from './block';
2
+ export * from './coach';
3
+ export * from './country';
4
+ export * from './draft';
5
+ export * from './draft-pick';
6
+ export * from './event';
7
+ export * from './iteration';
8
+ export * from './league';
9
+ export * from './libero-replacement';
10
+ export * from './match';
11
+ export * from './match-rating';
12
+ export * from './match-set';
13
+ export * from './match-set-stats';
14
+ export * from './performance-stats';
15
+ export * from './player';
16
+ export * from './player-team';
17
+ export * from './rally';
18
+ export * from './rally-position';
19
+ export * from './reception';
20
+ export * from './score';
21
+ export * from './season';
22
+ export * from './season-match';
23
+ export * from './season-teams';
24
+ export * from './serve';
25
+ export * from './set';
26
+ export * from './spike';
27
+ export * from './substitution';
28
+ export * from './team';
29
+ export * from './tournament';
30
+ export * from './tournament-match';
31
+ export * from './tournament-teams';
32
+ export * from './user';