击杀阵亡比
This commit is contained in:
parent
0863b2fd71
commit
2a96f8efac
@ -116,13 +116,21 @@ namespace AnotherReplayReader.Apm
|
||||
dataList.Add(new("局域网 IP", plotter.Players.Select(GetIpAndName)));
|
||||
}
|
||||
apmRowIndex = dataList.Count;
|
||||
// kill-death ratio
|
||||
if (plotter.Replay.Footer?.TryGetKillDeathRatios() is { } kdRatios)
|
||||
{
|
||||
var texts = kdRatios
|
||||
.Take(plotter.Players.Length)
|
||||
.Select(x => $"{x:0.##}");
|
||||
dataList.Add(new("击杀阵亡比(存疑)", texts));
|
||||
}
|
||||
// get commands
|
||||
var commandCounts = plotter.GetCommandCounts(begin, end);
|
||||
// add commands in the order specified by the list
|
||||
foreach (var command in orderedCommands)
|
||||
{
|
||||
var counts = commandCounts.TryGetValue(command, out var stored)
|
||||
? stored
|
||||
var counts = commandCounts.TryGetValue(command, out var stored)
|
||||
? stored
|
||||
: new int[plotter.Players.Length];
|
||||
if (!isPartial || counts.Any(x => x > 0))
|
||||
{
|
||||
|
@ -112,13 +112,13 @@ namespace AnotherReplayReader
|
||||
}
|
||||
return plotter.PlayerLifes[i] < begin
|
||||
? "玩家已战败"
|
||||
: $"{v:#.##}";
|
||||
: $"{v:0.##}";
|
||||
}
|
||||
list.Insert(apmIndex, new(DataRow.PartialApmRow,
|
||||
list.Insert(apmIndex, new(DataRow.PartialApmRow,
|
||||
instantApms.Select(PartialApmToString)));
|
||||
}
|
||||
list.Insert(apmIndex, new(DataRow.AverageApmRow,
|
||||
avg.Select(v => $"{v:#.##}")));
|
||||
list.Insert(apmIndex, new(DataRow.AverageApmRow,
|
||||
avg.Select(v => $"{v:0.##}")));
|
||||
|
||||
return (list, data, plotter.ReplayLength, isPartial);
|
||||
});
|
||||
@ -203,7 +203,7 @@ namespace AnotherReplayReader
|
||||
|
||||
private int NormalizeResolutionInput(string text)
|
||||
{
|
||||
if(!int.TryParse(text, out var value))
|
||||
if (!int.TryParse(text, out var value))
|
||||
{
|
||||
value = (int)PlotResolution.TotalSeconds;
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -62,18 +61,21 @@ namespace AnotherReplayReader.ReplayFile
|
||||
_data = new byte[] { 0x02, 0x1A, 0x00, 0x00, 0x00 };
|
||||
}
|
||||
|
||||
List<float>? TryGetKillDeathRatio()
|
||||
public float[]? TryGetKillDeathRatios()
|
||||
{
|
||||
if (_data.Length < 24)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var ratios = new List<float>();
|
||||
var ratios = new float[6];
|
||||
using var stream = new MemoryStream(_data, _data.Length - 24, 24);
|
||||
using var reader = new BinaryReader(stream);
|
||||
ratios.Add(reader.ReadSingle());
|
||||
throw new NotImplementedException();
|
||||
for (var i = 0; i < ratios.Length; ++i)
|
||||
{
|
||||
ratios[i] = reader.ReadSingle();
|
||||
}
|
||||
return ratios;
|
||||
}
|
||||
|
||||
public void WriteTo(BinaryWriter writer)
|
||||
|
Loading…
x
Reference in New Issue
Block a user