volleyballsimtypes 0.0.130 → 0.0.132
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/data/transformers/player.d.ts +3 -2
- package/dist/cjs/src/data/transformers/player.js +23 -21
- package/dist/cjs/src/service/match/match-rating.d.ts +2 -2
- package/dist/cjs/src/service/match/match-rating.js +2 -3
- package/dist/esm/src/data/transformers/player.d.ts +3 -2
- package/dist/esm/src/data/transformers/player.js +22 -21
- package/dist/esm/src/service/match/match-rating.d.ts +2 -2
- package/dist/esm/src/service/match/match-rating.js +2 -3
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { PlayerAttributes, PlayerModel } from '../models';
|
|
2
2
|
import { Player } from '../../service';
|
|
3
|
-
import { APIPlayer } from '../../api';
|
|
3
|
+
import { APIPlayer, APISetStatistics } from '../../api';
|
|
4
4
|
declare function transformToAttributes(player: Player): PlayerAttributes;
|
|
5
5
|
declare function transformToObject(model: PlayerModel): Player;
|
|
6
6
|
declare function transformToAPIObject(model: PlayerModel, team: string, jerseyNumber: number): APIPlayer;
|
|
7
|
-
|
|
7
|
+
declare function reduceStatsFn(acc: APISetStatistics, current: APISetStatistics): APISetStatistics;
|
|
8
|
+
export { transformToObject as transformToPlayer, transformToAPIObject as transformToAPIPlayer, transformToAttributes as transformFromPlayer, reduceStatsFn };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformFromPlayer = exports.transformToAPIPlayer = exports.transformToPlayer = void 0;
|
|
3
|
+
exports.reduceStatsFn = exports.transformFromPlayer = exports.transformToAPIPlayer = exports.transformToPlayer = void 0;
|
|
4
4
|
const service_1 = require("../../service");
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
function transformToAttributes(player) {
|
|
@@ -72,24 +72,26 @@ function calculateMatchStats(gameStats) {
|
|
|
72
72
|
assists: 0,
|
|
73
73
|
order: gameStats.length
|
|
74
74
|
};
|
|
75
|
-
return gameStats.reduce(
|
|
76
|
-
acc.attempts += current.attempts;
|
|
77
|
-
acc.contacts += current.contacts;
|
|
78
|
-
acc.ralliesPlayed += current.ralliesPlayed;
|
|
79
|
-
acc.kills += current.kills;
|
|
80
|
-
acc.killBlocks += current.killBlocks;
|
|
81
|
-
acc.ace += current.ace;
|
|
82
|
-
acc.assists += current.assists;
|
|
83
|
-
acc.serve.success += current.serve.success;
|
|
84
|
-
acc.serve.error += current.serve.error;
|
|
85
|
-
acc.reception.success += current.reception.success;
|
|
86
|
-
acc.reception.error += current.reception.error;
|
|
87
|
-
acc.set.success += current.set.success;
|
|
88
|
-
acc.set.error += current.set.error;
|
|
89
|
-
acc.attack.success += current.attack.success;
|
|
90
|
-
acc.attack.error += current.attack.error;
|
|
91
|
-
acc.block.success += current.block.success;
|
|
92
|
-
acc.block.error += current.block.error;
|
|
93
|
-
return acc;
|
|
94
|
-
}, emptyStats);
|
|
75
|
+
return gameStats.reduce(reduceStatsFn, emptyStats);
|
|
95
76
|
}
|
|
77
|
+
function reduceStatsFn(acc, current) {
|
|
78
|
+
acc.attempts += current.attempts;
|
|
79
|
+
acc.contacts += current.contacts;
|
|
80
|
+
acc.ralliesPlayed += current.ralliesPlayed;
|
|
81
|
+
acc.kills += current.kills;
|
|
82
|
+
acc.killBlocks += current.killBlocks;
|
|
83
|
+
acc.ace += current.ace;
|
|
84
|
+
acc.assists += current.assists;
|
|
85
|
+
acc.serve.success += current.serve.success;
|
|
86
|
+
acc.serve.error += current.serve.error;
|
|
87
|
+
acc.reception.success += current.reception.success;
|
|
88
|
+
acc.reception.error += current.reception.error;
|
|
89
|
+
acc.set.success += current.set.success;
|
|
90
|
+
acc.set.error += current.set.error;
|
|
91
|
+
acc.attack.success += current.attack.success;
|
|
92
|
+
acc.attack.error += current.attack.error;
|
|
93
|
+
acc.block.success += current.block.success;
|
|
94
|
+
acc.block.error += current.block.error;
|
|
95
|
+
return acc;
|
|
96
|
+
}
|
|
97
|
+
exports.reduceStatsFn = reduceStatsFn;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Match, MatchTeam } from '.';
|
|
2
|
-
import {
|
|
2
|
+
import { CompetitionType } from '../../data';
|
|
3
3
|
interface MatchRatingOpts {
|
|
4
4
|
readonly match: Match;
|
|
5
|
-
readonly competitionType:
|
|
5
|
+
readonly competitionType: CompetitionType;
|
|
6
6
|
}
|
|
7
7
|
interface SetScoreVariant {
|
|
8
8
|
'3-0': number;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MatchRating = void 0;
|
|
4
4
|
const _1 = require(".");
|
|
5
|
-
const competition_1 = require("../competition");
|
|
6
5
|
class MatchRating {
|
|
7
6
|
constructor({ match, competitionType }) {
|
|
8
7
|
this.match = match;
|
|
@@ -61,6 +60,6 @@ MatchRating.C3 = 0;
|
|
|
61
60
|
MatchRating.C4 = 0.394;
|
|
62
61
|
MatchRating.C5 = 1.060;
|
|
63
62
|
MatchRating.MWF = {
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
TOURNAMENT: 50,
|
|
64
|
+
LEAGUE: 35
|
|
66
65
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { PlayerAttributes, PlayerModel } from '../models';
|
|
2
2
|
import { Player } from '../../service';
|
|
3
|
-
import { APIPlayer } from '../../api';
|
|
3
|
+
import { APIPlayer, APISetStatistics } from '../../api';
|
|
4
4
|
declare function transformToAttributes(player: Player): PlayerAttributes;
|
|
5
5
|
declare function transformToObject(model: PlayerModel): Player;
|
|
6
6
|
declare function transformToAPIObject(model: PlayerModel, team: string, jerseyNumber: number): APIPlayer;
|
|
7
|
-
|
|
7
|
+
declare function reduceStatsFn(acc: APISetStatistics, current: APISetStatistics): APISetStatistics;
|
|
8
|
+
export { transformToObject as transformToPlayer, transformToAPIObject as transformToAPIPlayer, transformToAttributes as transformFromPlayer, reduceStatsFn };
|
|
@@ -66,25 +66,26 @@ function calculateMatchStats(gameStats) {
|
|
|
66
66
|
assists: 0,
|
|
67
67
|
order: gameStats.length
|
|
68
68
|
};
|
|
69
|
-
return gameStats.reduce(
|
|
70
|
-
acc.attempts += current.attempts;
|
|
71
|
-
acc.contacts += current.contacts;
|
|
72
|
-
acc.ralliesPlayed += current.ralliesPlayed;
|
|
73
|
-
acc.kills += current.kills;
|
|
74
|
-
acc.killBlocks += current.killBlocks;
|
|
75
|
-
acc.ace += current.ace;
|
|
76
|
-
acc.assists += current.assists;
|
|
77
|
-
acc.serve.success += current.serve.success;
|
|
78
|
-
acc.serve.error += current.serve.error;
|
|
79
|
-
acc.reception.success += current.reception.success;
|
|
80
|
-
acc.reception.error += current.reception.error;
|
|
81
|
-
acc.set.success += current.set.success;
|
|
82
|
-
acc.set.error += current.set.error;
|
|
83
|
-
acc.attack.success += current.attack.success;
|
|
84
|
-
acc.attack.error += current.attack.error;
|
|
85
|
-
acc.block.success += current.block.success;
|
|
86
|
-
acc.block.error += current.block.error;
|
|
87
|
-
return acc;
|
|
88
|
-
}, emptyStats);
|
|
69
|
+
return gameStats.reduce(reduceStatsFn, emptyStats);
|
|
89
70
|
}
|
|
90
|
-
|
|
71
|
+
function reduceStatsFn(acc, current) {
|
|
72
|
+
acc.attempts += current.attempts;
|
|
73
|
+
acc.contacts += current.contacts;
|
|
74
|
+
acc.ralliesPlayed += current.ralliesPlayed;
|
|
75
|
+
acc.kills += current.kills;
|
|
76
|
+
acc.killBlocks += current.killBlocks;
|
|
77
|
+
acc.ace += current.ace;
|
|
78
|
+
acc.assists += current.assists;
|
|
79
|
+
acc.serve.success += current.serve.success;
|
|
80
|
+
acc.serve.error += current.serve.error;
|
|
81
|
+
acc.reception.success += current.reception.success;
|
|
82
|
+
acc.reception.error += current.reception.error;
|
|
83
|
+
acc.set.success += current.set.success;
|
|
84
|
+
acc.set.error += current.set.error;
|
|
85
|
+
acc.attack.success += current.attack.success;
|
|
86
|
+
acc.attack.error += current.attack.error;
|
|
87
|
+
acc.block.success += current.block.success;
|
|
88
|
+
acc.block.error += current.block.error;
|
|
89
|
+
return acc;
|
|
90
|
+
}
|
|
91
|
+
export { transformToObject as transformToPlayer, transformToAPIObject as transformToAPIPlayer, transformToAttributes as transformFromPlayer, reduceStatsFn };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Match, MatchTeam } from '.';
|
|
2
|
-
import {
|
|
2
|
+
import { CompetitionType } from '../../data';
|
|
3
3
|
interface MatchRatingOpts {
|
|
4
4
|
readonly match: Match;
|
|
5
|
-
readonly competitionType:
|
|
5
|
+
readonly competitionType: CompetitionType;
|
|
6
6
|
}
|
|
7
7
|
interface SetScoreVariant {
|
|
8
8
|
'3-0': number;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { MatchScore } from '.';
|
|
2
|
-
import { _CompetitionType } from '../competition';
|
|
3
2
|
export class MatchRating {
|
|
4
3
|
constructor({ match, competitionType }) {
|
|
5
4
|
this.match = match;
|
|
@@ -57,6 +56,6 @@ MatchRating.C3 = 0;
|
|
|
57
56
|
MatchRating.C4 = 0.394;
|
|
58
57
|
MatchRating.C5 = 1.060;
|
|
59
58
|
MatchRating.MWF = {
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
TOURNAMENT: 50,
|
|
60
|
+
LEAGUE: 35
|
|
62
61
|
};
|