volleyballsimtypes 0.0.413 → 0.0.415
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.
- package/dist/cjs/src/service/match/match-generator.js +6 -1
- package/dist/cjs/src/service/player/trait.d.ts +3 -1
- package/dist/cjs/src/service/player/trait.js +3 -1
- package/dist/cjs/src/stat-config/traits.json +4 -2
- package/dist/esm/src/service/match/match-generator.js +6 -1
- package/dist/esm/src/service/player/trait.d.ts +3 -1
- package/dist/esm/src/service/player/trait.js +3 -1
- package/dist/esm/src/stat-config/traits.json +4 -2
- package/package.json +1 -1
|
@@ -4,15 +4,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
7
|
+
const utc_1 = __importDefault(require("dayjs/plugin/utc"));
|
|
7
8
|
const uuid_1 = require("uuid");
|
|
8
9
|
const match_1 = require("./match");
|
|
9
10
|
const utils_1 = require("../utils");
|
|
10
11
|
const data_1 = require("../../data");
|
|
12
|
+
dayjs_1.default.extend(utc_1.default);
|
|
11
13
|
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
12
14
|
class MatchGenerator {
|
|
13
15
|
static generateMatches(teams, baseDate) {
|
|
14
16
|
const t = new Set(teams.map(x => x.id));
|
|
15
|
-
|
|
17
|
+
// Anchor the first match to 00:00 UTC of the iteration's start day (Monday), so league rounds fall on the
|
|
18
|
+
// same wall-clock time everywhere regardless of the host timezone. startOf('day') in UTC avoids the
|
|
19
|
+
// local-timezone roll the old startOf('hour') was exposed to on a fractional-hour-offset host.
|
|
20
|
+
let date = dayjs_1.default.utc(baseDate).startOf('day');
|
|
16
21
|
if (t.size !== teams.length) {
|
|
17
22
|
throw new Error('DUPLICATE_TEAMS');
|
|
18
23
|
}
|
|
@@ -17,7 +17,9 @@ export declare enum TraitEnum {
|
|
|
17
17
|
*/
|
|
18
18
|
MOVING_WALL = "MOVING_WALL",
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Two effects. As a setter it multiplies the front-row dump chance (which every setter has, scaled by
|
|
21
|
+
* awareness) and makes the dump hit harder. As an attacker it gives each spike a chance to be treated like
|
|
22
|
+
* a dump by the block: at most one blocker, and only if the defence wins a reflex check (often none).
|
|
21
23
|
*/
|
|
22
24
|
SURPRISE_ATTACK = "SURPRISE_ATTACK",
|
|
23
25
|
/**
|
|
@@ -22,7 +22,9 @@ var TraitEnum;
|
|
|
22
22
|
*/
|
|
23
23
|
TraitEnum["MOVING_WALL"] = "MOVING_WALL";
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Two effects. As a setter it multiplies the front-row dump chance (which every setter has, scaled by
|
|
26
|
+
* awareness) and makes the dump hit harder. As an attacker it gives each spike a chance to be treated like
|
|
27
|
+
* a dump by the block: at most one blocker, and only if the defence wins a reflex check (often none).
|
|
26
28
|
*/
|
|
27
29
|
TraitEnum["SURPRISE_ATTACK"] = "SURPRISE_ATTACK";
|
|
28
30
|
/**
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import dayjs from 'dayjs';
|
|
2
|
+
import utc from 'dayjs/plugin/utc';
|
|
2
3
|
import { v4 as uuidv4 } from 'uuid';
|
|
3
4
|
import { Match } from './match';
|
|
4
5
|
import { shuffle } from '../utils';
|
|
5
6
|
import { StatusEnum } from '../../data';
|
|
7
|
+
dayjs.extend(utc);
|
|
6
8
|
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
7
9
|
export default class MatchGenerator {
|
|
8
10
|
static generateMatches(teams, baseDate) {
|
|
9
11
|
const t = new Set(teams.map(x => x.id));
|
|
10
|
-
|
|
12
|
+
// Anchor the first match to 00:00 UTC of the iteration's start day (Monday), so league rounds fall on the
|
|
13
|
+
// same wall-clock time everywhere regardless of the host timezone. startOf('day') in UTC avoids the
|
|
14
|
+
// local-timezone roll the old startOf('hour') was exposed to on a fractional-hour-offset host.
|
|
15
|
+
let date = dayjs.utc(baseDate).startOf('day');
|
|
11
16
|
if (t.size !== teams.length) {
|
|
12
17
|
throw new Error('DUPLICATE_TEAMS');
|
|
13
18
|
}
|
|
@@ -17,7 +17,9 @@ export declare enum TraitEnum {
|
|
|
17
17
|
*/
|
|
18
18
|
MOVING_WALL = "MOVING_WALL",
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Two effects. As a setter it multiplies the front-row dump chance (which every setter has, scaled by
|
|
21
|
+
* awareness) and makes the dump hit harder. As an attacker it gives each spike a chance to be treated like
|
|
22
|
+
* a dump by the block: at most one blocker, and only if the defence wins a reflex check (often none).
|
|
21
23
|
*/
|
|
22
24
|
SURPRISE_ATTACK = "SURPRISE_ATTACK",
|
|
23
25
|
/**
|
|
@@ -15,7 +15,9 @@ export var TraitEnum;
|
|
|
15
15
|
*/
|
|
16
16
|
TraitEnum["MOVING_WALL"] = "MOVING_WALL";
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Two effects. As a setter it multiplies the front-row dump chance (which every setter has, scaled by
|
|
19
|
+
* awareness) and makes the dump hit harder. As an attacker it gives each spike a chance to be treated like
|
|
20
|
+
* a dump by the block: at most one blocker, and only if the defence wins a reflex check (often none).
|
|
19
21
|
*/
|
|
20
22
|
TraitEnum["SURPRISE_ATTACK"] = "SURPRISE_ATTACK";
|
|
21
23
|
/**
|