Fix fraction stats graph views

pull/31/head
HardiReady 2018-03-12 08:14:54 +01:00
parent a8094ec802
commit 7d8c19e7ed
1 changed files with 11 additions and 10 deletions

View File

@ -177,7 +177,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
} }
let killCountBlufor = 0, killCountOpfor = 0, ffKillCountBlufor = 0, ffKillCountOpfor = 0; let killCountBlufor = 0, killCountOpfor = 0, ffKillCountBlufor = 0, ffKillCountOpfor = 0;
for (const {killEntry, index} of this.logData.kill.map((entry, pos) => ({entry, pos}))) { for (const {killEntry, index} of this.logData.kill.map((kill, pos) => ({killEntry: kill, index: pos}))) {
const killEntryDate = new Date(killEntry.time); const killEntryDate = new Date(killEntry.time);
if (killEntry.friendlyFire === false) { if (killEntry.friendlyFire === false) {
if (killEntry.fraction === 'BLUFOR') { if (killEntry.fraction === 'BLUFOR') {
@ -220,7 +220,7 @@ export class FractionStatsComponent implements OnInit, OnChanges {
return; return;
} }
let reviveCountBlufor = 0, reviveCountOpfor = 0, stabilizeCountBlufor = 0, stabilizeCountOpfor = 0; let reviveCountBlufor = 0, reviveCountOpfor = 0, stabilizeCountBlufor = 0, stabilizeCountOpfor = 0;
for (const {reviveEntry, index} of this.logData.revive.map((entry, pos) => ({entry, pos}))) { for (const {reviveEntry, index} of this.logData.revive.map((revive, pos) => ({reviveEntry: revive, index: pos}))) {
const reviveEntryDate = new Date(reviveEntry.time); const reviveEntryDate = new Date(reviveEntry.time);
if (reviveEntry.stabilized === false) { if (reviveEntry.stabilized === false) {
if (reviveEntry.fraction === 'BLUFOR') { if (reviveEntry.fraction === 'BLUFOR') {
@ -260,9 +260,9 @@ export class FractionStatsComponent implements OnInit, OnChanges {
return; return;
} }
let vehicleKillCountBlufor = 0, vehicleKillCountOpfor = 0; let vehicleKillCountBlufor = 0, vehicleKillCountOpfor = 0;
for (const {transportEntry: vehicleEntry, index} of this.logData.vehicle.map((entry, pos) => ({ for (const {transportEntry: vehicleEntry, index} of this.logData.vehicle.map((transport, pos) => ({
pos, transportEntry: transport,
index index: pos
}))) { }))) {
const vehicleEntryDate = new Date(vehicleEntry.time); const vehicleEntryDate = new Date(vehicleEntry.time);
if (vehicleEntry.fraction === 'BLUFOR') { if (vehicleEntry.fraction === 'BLUFOR') {
@ -284,9 +284,9 @@ export class FractionStatsComponent implements OnInit, OnChanges {
return; return;
} }
let transportCountBlufor = 0, transportCountOpfor = 0; let transportCountBlufor = 0, transportCountOpfor = 0;
for (const {transportEntry, index} of this.logData.transport.map((entry, pos) => ({ for (const {transportEntry, index} of this.logData.transport.map((transport, pos) => ({
entry, transportEntry: transport,
pos index: pos
}))) { }))) {
const transportEntryDate = new Date(transportEntry.time); const transportEntryDate = new Date(transportEntry.time);
if (transportEntry.fraction === 'BLUFOR') { if (transportEntry.fraction === 'BLUFOR') {
@ -360,8 +360,9 @@ export class FractionStatsComponent implements OnInit, OnChanges {
} else { } else {
for (const j in [0, 1]) { for (const j in [0, 1]) {
if (tmpCollection[j].series[tmpCollection[j].series.length - 1].name < endDate) { if (tmpCollection[j].series[tmpCollection[j].series.length - 1].name < endDate) {
tmpCollection[j].series.push(ChartUtils.getSeriesEntry(endDate, tmpCollection[j] tmpCollection[j].series.push(
.series[tmpCollection[j].series.length - 1].value)); ChartUtils.getSeriesEntry(endDate, tmpCollection[j].series[tmpCollection[j].series.length - 1].value)
);
} }
} }
} }