volleyballsimtypes 0.0.502 → 0.0.504

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.
@@ -5,7 +5,7 @@ const zod_1 = require("zod");
5
5
  const player_1 = require("../../player");
6
6
  const incident_z_1 = require("./incident.z");
7
7
  const positional_z_1 = require("./positional.z");
8
- const spikeTypeValues = [0, 1, 2, 3, 4, 5];
8
+ const spikeTypeValues = [0, 1, 2, 3, 4, 5, 6];
9
9
  const spikeFailureValues = [0, 1, 2, 3, 4];
10
10
  const courtTargetValues = Array.from({ length: 13 }, (_, i) => i);
11
11
  exports.SpikeInputSchema = zod_1.z.object({
@@ -5,9 +5,10 @@ export declare enum SpikeTypeEnum {
5
5
  REVERSE_CROSS = 2,
6
6
  TIP = 3,
7
7
  DOWN_BALL = 4,
8
- OVERHAND = 5
8
+ OVERHAND = 5,
9
+ TOOL = 6
9
10
  }
10
- export type SpikeType = SpikeTypeEnum.CROSS_SHOT | SpikeTypeEnum.LINE_SHOT | SpikeTypeEnum.REVERSE_CROSS | SpikeTypeEnum.TIP | SpikeTypeEnum.DOWN_BALL | SpikeTypeEnum.OVERHAND;
11
+ export type SpikeType = SpikeTypeEnum.CROSS_SHOT | SpikeTypeEnum.LINE_SHOT | SpikeTypeEnum.REVERSE_CROSS | SpikeTypeEnum.TIP | SpikeTypeEnum.DOWN_BALL | SpikeTypeEnum.OVERHAND | SpikeTypeEnum.TOOL;
11
12
  export declare enum SpikeFailureEnum {
12
13
  NO_FAILURE = 0,
13
14
  FAULT = 1,
@@ -12,6 +12,10 @@ var SpikeTypeEnum;
12
12
  SpikeTypeEnum[SpikeTypeEnum["TIP"] = 3] = "TIP";
13
13
  SpikeTypeEnum[SpikeTypeEnum["DOWN_BALL"] = 4] = "DOWN_BALL";
14
14
  SpikeTypeEnum[SpikeTypeEnum["OVERHAND"] = 5] = "OVERHAND";
15
+ // A ball intentionally wiped/deflected off the block and out: the ATTACKER's shot (a kill), the block earns a
16
+ // TOUCH (FIVB: NOT a block error). Distinct from the legacy BlockFailureEnum.TOOL/WIPE, which the older zone
17
+ // engine still uses to mis-book a tool-out as a block error.
18
+ SpikeTypeEnum[SpikeTypeEnum["TOOL"] = 6] = "TOOL";
15
19
  })(SpikeTypeEnum || (exports.SpikeTypeEnum = SpikeTypeEnum = {}));
16
20
  var SpikeFailureEnum;
17
21
  (function (SpikeFailureEnum) {
@@ -3,7 +3,7 @@ import { Team } from '../team';
3
3
  import { MatchTeam } from './match-team';
4
4
  import { StatusEnum } from '../../data';
5
5
  import { VPER } from './vper';
6
- export type MatchForfeitType = 'INCOMPLETE' | 'DEFAULT';
6
+ export type MatchForfeitType = 'INCOMPLETE' | 'DEFAULT' | 'DOUBLE_FORFEIT';
7
7
  export type MatchScore = '3-0' | '3-1' | '3-2' | '2-3' | '1-3' | '0-3';
8
8
  export type SetScore = 0 | 1 | 2 | 3;
9
9
  export declare class Match {
@@ -21,6 +21,7 @@ export declare const MatchInputSchema: z.ZodObject<{
21
21
  forfeitType: z.ZodOptional<z.ZodEnum<{
22
22
  INCOMPLETE: "INCOMPLETE";
23
23
  DEFAULT: "DEFAULT";
24
+ DOUBLE_FORFEIT: "DOUBLE_FORFEIT";
24
25
  }>>;
25
26
  }, z.core.$strip>;
26
27
  export type MatchInput = z.infer<typeof MatchInputSchema>;
@@ -25,8 +25,8 @@ exports.MatchInputSchema = zod_1.z.object({
25
25
  awayScore: zod_1.z.number().int().optional(),
26
26
  winner: teamSchema.optional(),
27
27
  // Abnormal ending marker (see MatchForfeitType). The match still validates as a normal COMPLETE result
28
- // because forfeited sets carry FIVB-awarded scores.
29
- forfeitType: zod_1.z.enum(['INCOMPLETE', 'DEFAULT']).optional()
28
+ // because forfeited sets carry FIVB-awarded scores (DOUBLE_FORFEIT is the exception: no winner, 0-0).
29
+ forfeitType: zod_1.z.enum(['INCOMPLETE', 'DEFAULT', 'DOUBLE_FORFEIT']).optional()
30
30
  }).superRefine((data, ctx) => {
31
31
  if (data.homeTeam.id === data.awayTeam.id) {
32
32
  ctx.addIssue({
@@ -35,9 +35,12 @@ exports.MatchInputSchema = zod_1.z.object({
35
35
  path: ['awayTeam', 'id']
36
36
  });
37
37
  }
38
+ const isDoubleForfeit = data.forfeitType === 'DOUBLE_FORFEIT';
38
39
  if (data.sets !== undefined) {
39
40
  const n = data.sets.length;
40
- if (n !== 0 && (n < 3 || n > 5)) {
41
+ // A DOUBLE_FORFEIT (both teams unable to field six) can end at ANY point, so it keeps 0-5 played sets rather
42
+ // than the 0-or-3-to-5 a normal result requires.
43
+ if (isDoubleForfeit ? n > 5 : (n !== 0 && (n < 3 || n > 5))) {
41
44
  ctx.addIssue({
42
45
  code: 'custom',
43
46
  message: 'SETS_LENGTH_MUST_BE_0_OR_BETWEEN_3_AND_5',
@@ -100,7 +103,8 @@ exports.MatchInputSchema = zod_1.z.object({
100
103
  path: ['awayScore']
101
104
  });
102
105
  }
103
- if (homeScore !== 3 && awayScore !== 3) {
106
+ // A DOUBLE_FORFEIT has NO winner: both sides lose 0-3 (homeScore = awayScore = 0), so the reached-3 rule is waived.
107
+ if (!isDoubleForfeit && homeScore !== 3 && awayScore !== 3) {
104
108
  ctx.addIssue({
105
109
  code: 'custom',
106
110
  message: 'MATCH_COMPLETE_REQUIRES_A_TEAM_TO_HAVE_3_SETS',
@@ -32,7 +32,10 @@
32
32
  "OPPOSITE_HITTER",
33
33
  "SETTER",
34
34
  "OUTSIDE_HITTER"
35
- ]
35
+ ],
36
+ "params": {
37
+ "range": 3
38
+ }
36
39
  },
37
40
  {
38
41
  "name": "MARKSMAN",
@@ -42,7 +45,10 @@
42
45
  "SETTER",
43
46
  "OPPOSITE_HITTER",
44
47
  "OUTSIDE_HITTER"
45
- ]
48
+ ],
49
+ "params": {
50
+ "primaryScore": 1.1
51
+ }
46
52
  },
47
53
  {
48
54
  "name": "METEOR_SERVE",
@@ -87,7 +93,10 @@
87
93
  "roles": [
88
94
  "LIBERO",
89
95
  "OUTSIDE_HITTER"
90
- ]
96
+ ],
97
+ "params": {
98
+ "range": 4
99
+ }
91
100
  },
92
101
  {
93
102
  "name": "DEFENSIVE_SPECIALIST",
@@ -209,7 +218,9 @@
209
218
  ],
210
219
  "params": {
211
220
  "servePower": 1.08,
212
- "attackFactor": 0.66
221
+ "attackFactor": 0.66,
222
+ "frontScore": 1.2,
223
+ "backScore": 1.1
213
224
  }
214
225
  },
215
226
  {
@@ -2,7 +2,7 @@ import { z } from 'zod';
2
2
  import { TraitEnum } from '../../player';
3
3
  import { EventIncidentSchema } from './incident.z';
4
4
  import { positionalEventFields } from './positional.z';
5
- const spikeTypeValues = [0, 1, 2, 3, 4, 5];
5
+ const spikeTypeValues = [0, 1, 2, 3, 4, 5, 6];
6
6
  const spikeFailureValues = [0, 1, 2, 3, 4];
7
7
  const courtTargetValues = Array.from({ length: 13 }, (_, i) => i);
8
8
  export const SpikeInputSchema = z.object({
@@ -5,9 +5,10 @@ export declare enum SpikeTypeEnum {
5
5
  REVERSE_CROSS = 2,
6
6
  TIP = 3,
7
7
  DOWN_BALL = 4,
8
- OVERHAND = 5
8
+ OVERHAND = 5,
9
+ TOOL = 6
9
10
  }
10
- export type SpikeType = SpikeTypeEnum.CROSS_SHOT | SpikeTypeEnum.LINE_SHOT | SpikeTypeEnum.REVERSE_CROSS | SpikeTypeEnum.TIP | SpikeTypeEnum.DOWN_BALL | SpikeTypeEnum.OVERHAND;
11
+ export type SpikeType = SpikeTypeEnum.CROSS_SHOT | SpikeTypeEnum.LINE_SHOT | SpikeTypeEnum.REVERSE_CROSS | SpikeTypeEnum.TIP | SpikeTypeEnum.DOWN_BALL | SpikeTypeEnum.OVERHAND | SpikeTypeEnum.TOOL;
11
12
  export declare enum SpikeFailureEnum {
12
13
  NO_FAILURE = 0,
13
14
  FAULT = 1,
@@ -9,6 +9,10 @@ export var SpikeTypeEnum;
9
9
  SpikeTypeEnum[SpikeTypeEnum["TIP"] = 3] = "TIP";
10
10
  SpikeTypeEnum[SpikeTypeEnum["DOWN_BALL"] = 4] = "DOWN_BALL";
11
11
  SpikeTypeEnum[SpikeTypeEnum["OVERHAND"] = 5] = "OVERHAND";
12
+ // A ball intentionally wiped/deflected off the block and out: the ATTACKER's shot (a kill), the block earns a
13
+ // TOUCH (FIVB: NOT a block error). Distinct from the legacy BlockFailureEnum.TOOL/WIPE, which the older zone
14
+ // engine still uses to mis-book a tool-out as a block error.
15
+ SpikeTypeEnum[SpikeTypeEnum["TOOL"] = 6] = "TOOL";
12
16
  })(SpikeTypeEnum || (SpikeTypeEnum = {}));
13
17
  export var SpikeFailureEnum;
14
18
  (function (SpikeFailureEnum) {
@@ -3,7 +3,7 @@ import { Team } from '../team';
3
3
  import { MatchTeam } from './match-team';
4
4
  import { StatusEnum } from '../../data';
5
5
  import { VPER } from './vper';
6
- export type MatchForfeitType = 'INCOMPLETE' | 'DEFAULT';
6
+ export type MatchForfeitType = 'INCOMPLETE' | 'DEFAULT' | 'DOUBLE_FORFEIT';
7
7
  export type MatchScore = '3-0' | '3-1' | '3-2' | '2-3' | '1-3' | '0-3';
8
8
  export type SetScore = 0 | 1 | 2 | 3;
9
9
  export declare class Match {
@@ -21,6 +21,7 @@ export declare const MatchInputSchema: z.ZodObject<{
21
21
  forfeitType: z.ZodOptional<z.ZodEnum<{
22
22
  INCOMPLETE: "INCOMPLETE";
23
23
  DEFAULT: "DEFAULT";
24
+ DOUBLE_FORFEIT: "DOUBLE_FORFEIT";
24
25
  }>>;
25
26
  }, z.core.$strip>;
26
27
  export type MatchInput = z.infer<typeof MatchInputSchema>;
@@ -22,8 +22,8 @@ export const MatchInputSchema = z.object({
22
22
  awayScore: z.number().int().optional(),
23
23
  winner: teamSchema.optional(),
24
24
  // Abnormal ending marker (see MatchForfeitType). The match still validates as a normal COMPLETE result
25
- // because forfeited sets carry FIVB-awarded scores.
26
- forfeitType: z.enum(['INCOMPLETE', 'DEFAULT']).optional()
25
+ // because forfeited sets carry FIVB-awarded scores (DOUBLE_FORFEIT is the exception: no winner, 0-0).
26
+ forfeitType: z.enum(['INCOMPLETE', 'DEFAULT', 'DOUBLE_FORFEIT']).optional()
27
27
  }).superRefine((data, ctx) => {
28
28
  if (data.homeTeam.id === data.awayTeam.id) {
29
29
  ctx.addIssue({
@@ -32,9 +32,12 @@ export const MatchInputSchema = z.object({
32
32
  path: ['awayTeam', 'id']
33
33
  });
34
34
  }
35
+ const isDoubleForfeit = data.forfeitType === 'DOUBLE_FORFEIT';
35
36
  if (data.sets !== undefined) {
36
37
  const n = data.sets.length;
37
- if (n !== 0 && (n < 3 || n > 5)) {
38
+ // A DOUBLE_FORFEIT (both teams unable to field six) can end at ANY point, so it keeps 0-5 played sets rather
39
+ // than the 0-or-3-to-5 a normal result requires.
40
+ if (isDoubleForfeit ? n > 5 : (n !== 0 && (n < 3 || n > 5))) {
38
41
  ctx.addIssue({
39
42
  code: 'custom',
40
43
  message: 'SETS_LENGTH_MUST_BE_0_OR_BETWEEN_3_AND_5',
@@ -97,7 +100,8 @@ export const MatchInputSchema = z.object({
97
100
  path: ['awayScore']
98
101
  });
99
102
  }
100
- if (homeScore !== 3 && awayScore !== 3) {
103
+ // A DOUBLE_FORFEIT has NO winner: both sides lose 0-3 (homeScore = awayScore = 0), so the reached-3 rule is waived.
104
+ if (!isDoubleForfeit && homeScore !== 3 && awayScore !== 3) {
101
105
  ctx.addIssue({
102
106
  code: 'custom',
103
107
  message: 'MATCH_COMPLETE_REQUIRES_A_TEAM_TO_HAVE_3_SETS',
@@ -32,7 +32,10 @@
32
32
  "OPPOSITE_HITTER",
33
33
  "SETTER",
34
34
  "OUTSIDE_HITTER"
35
- ]
35
+ ],
36
+ "params": {
37
+ "range": 3
38
+ }
36
39
  },
37
40
  {
38
41
  "name": "MARKSMAN",
@@ -42,7 +45,10 @@
42
45
  "SETTER",
43
46
  "OPPOSITE_HITTER",
44
47
  "OUTSIDE_HITTER"
45
- ]
48
+ ],
49
+ "params": {
50
+ "primaryScore": 1.1
51
+ }
46
52
  },
47
53
  {
48
54
  "name": "METEOR_SERVE",
@@ -87,7 +93,10 @@
87
93
  "roles": [
88
94
  "LIBERO",
89
95
  "OUTSIDE_HITTER"
90
- ]
96
+ ],
97
+ "params": {
98
+ "range": 4
99
+ }
91
100
  },
92
101
  {
93
102
  "name": "DEFENSIVE_SPECIALIST",
@@ -209,7 +218,9 @@
209
218
  ],
210
219
  "params": {
211
220
  "servePower": 1.08,
212
- "attackFactor": 0.66
221
+ "attackFactor": 0.66,
222
+ "frontScore": 1.2,
223
+ "backScore": 1.1
213
224
  }
214
225
  },
215
226
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volleyballsimtypes",
3
- "version": "0.0.502",
3
+ "version": "0.0.504",
4
4
  "description": "vbsim types",
5
5
  "main": "./dist/cjs/src/index.js",
6
6
  "module": "./dist/esm/src/index.js",