干掉了浩方查马甲代码

This commit is contained in:
2024-08-24 01:54:11 +02:00
parent 08700abd4f
commit 66458e831c
15 changed files with 217 additions and 434 deletions

View File

@@ -6,27 +6,23 @@ namespace AnotherReplayReader.Utils
{
internal class ReplayPinyinList
{
private readonly PlayerIdentity _playerIdentity;
public ImmutableArray<Replay> Replays { get; } = ImmutableArray<Replay>.Empty;
public ImmutableArray<ReplayPinyinData> Pinyins { get; } = ImmutableArray<ReplayPinyinData>.Empty;
public ReplayPinyinList(PlayerIdentity playerIdentity) :
this(ImmutableArray<Replay>.Empty, playerIdentity)
public ReplayPinyinList() :
this(ImmutableArray<Replay>.Empty)
{
}
public ReplayPinyinList(ImmutableArray<Replay> replay, PlayerIdentity playerIdentity) :
public ReplayPinyinList(ImmutableArray<Replay> replay) :
this(replay,
replay.Select(replay => new ReplayPinyinData(replay, playerIdentity)).ToImmutableArray(),
playerIdentity)
replay.Select(replay => new ReplayPinyinData(replay)).ToImmutableArray())
{
}
private ReplayPinyinList(ImmutableArray<Replay> replay,
ImmutableArray<ReplayPinyinData> pinyins,
PlayerIdentity playerIdentity)
ImmutableArray<ReplayPinyinData> pinyins)
{
_playerIdentity = playerIdentity;
Replays = replay;
Pinyins = pinyins;
}
@@ -34,8 +30,7 @@ namespace AnotherReplayReader.Utils
public ReplayPinyinList SetItem(int index, Replay replay)
{
return new(Replays.SetItem(index, replay),
Pinyins.SetItem(index, new(replay, _playerIdentity)),
_playerIdentity);
Pinyins.SetItem(index, new(replay)));
}
}
@@ -45,10 +40,10 @@ namespace AnotherReplayReader.Utils
public string? PinyinDetails { get; }
public string? PinyinMod { get; }
public ReplayPinyinData(Replay replay, PlayerIdentity playerIdentity)
public ReplayPinyinData(Replay replay)
{
Replay = replay;
PinyinDetails = replay.GetDetails(playerIdentity).ToPinyin();
PinyinDetails = replay.GetDetails().ToPinyin();
PinyinMod = replay.Mod.ModName.ToPinyin();
}