volleyballsimtypes 0.0.131 → 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.
|
@@ -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,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 };
|