volleyballsimtypes 0.0.201 → 0.0.202

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.
@@ -22,4 +22,5 @@ export declare class Tactics {
22
22
  readonly liberoReplacements: Player[];
23
23
  readonly pinchServerSubs: Map<Player, Player>;
24
24
  constructor({ lineup, pinchServerSubs, liberoReplacements, substitutionTolerance }: TacticsOpts);
25
+ findPlayerInLineup(id: string): CourtPosition | undefined;
25
26
  }
@@ -9,5 +9,23 @@ class Tactics {
9
9
  this.pinchServerSubs = pinchServerSubs;
10
10
  this.liberoReplacements = liberoReplacements;
11
11
  }
12
+ findPlayerInLineup(id) {
13
+ if (this.lineup.bench.some(p => p.id === id))
14
+ return match_1.CourtPosition.NOT_IN_COURT;
15
+ if (this.lineup[match_1.CourtPosition.LEFT_FRONT].id === id)
16
+ return match_1.CourtPosition.LEFT_FRONT;
17
+ if (this.lineup[match_1.CourtPosition.MIDDLE_FRONT].id === id)
18
+ return match_1.CourtPosition.MIDDLE_FRONT;
19
+ if (this.lineup[match_1.CourtPosition.RIGHT_FRONT].id === id)
20
+ return match_1.CourtPosition.RIGHT_FRONT;
21
+ if (this.lineup[match_1.CourtPosition.LEFT_BACK].id === id)
22
+ return match_1.CourtPosition.LEFT_BACK;
23
+ if (this.lineup[match_1.CourtPosition.MIDDLE_BACK].id === id)
24
+ return match_1.CourtPosition.MIDDLE_BACK;
25
+ if (this.lineup[match_1.CourtPosition.RIGHT_BACK].id === id)
26
+ return match_1.CourtPosition.RIGHT_BACK;
27
+ if (this.lineup[match_1.CourtPosition.LIBERO_ZONE]?.id === id)
28
+ return match_1.CourtPosition.LIBERO_ZONE;
29
+ }
12
30
  }
13
31
  exports.Tactics = Tactics;
@@ -22,4 +22,5 @@ export declare class Tactics {
22
22
  readonly liberoReplacements: Player[];
23
23
  readonly pinchServerSubs: Map<Player, Player>;
24
24
  constructor({ lineup, pinchServerSubs, liberoReplacements, substitutionTolerance }: TacticsOpts);
25
+ findPlayerInLineup(id: string): CourtPosition | undefined;
25
26
  }
@@ -6,4 +6,22 @@ export class Tactics {
6
6
  this.pinchServerSubs = pinchServerSubs;
7
7
  this.liberoReplacements = liberoReplacements;
8
8
  }
9
+ findPlayerInLineup(id) {
10
+ if (this.lineup.bench.some(p => p.id === id))
11
+ return CourtPosition.NOT_IN_COURT;
12
+ if (this.lineup[CourtPosition.LEFT_FRONT].id === id)
13
+ return CourtPosition.LEFT_FRONT;
14
+ if (this.lineup[CourtPosition.MIDDLE_FRONT].id === id)
15
+ return CourtPosition.MIDDLE_FRONT;
16
+ if (this.lineup[CourtPosition.RIGHT_FRONT].id === id)
17
+ return CourtPosition.RIGHT_FRONT;
18
+ if (this.lineup[CourtPosition.LEFT_BACK].id === id)
19
+ return CourtPosition.LEFT_BACK;
20
+ if (this.lineup[CourtPosition.MIDDLE_BACK].id === id)
21
+ return CourtPosition.MIDDLE_BACK;
22
+ if (this.lineup[CourtPosition.RIGHT_BACK].id === id)
23
+ return CourtPosition.RIGHT_BACK;
24
+ if (this.lineup[CourtPosition.LIBERO_ZONE]?.id === id)
25
+ return CourtPosition.LIBERO_ZONE;
26
+ }
9
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volleyballsimtypes",
3
- "version": "0.0.201",
3
+ "version": "0.0.202",
4
4
  "description": "vbsim types",
5
5
  "main": "./dist/cjs/src/index.js",
6
6
  "module": "./dist/esm/src/index.js",