Remove loadout template state wrapper
This commit is contained in:
parent
d4f6155cdc
commit
606144fe96
2 changed files with 14 additions and 18 deletions
|
|
@ -17800,11 +17800,11 @@ static void RequireInventoryLoadoutSaveRequestAuthority(string root)
|
|||
|
||||
var requiredLoadoutSnapshotProjectorSymbols = new[]
|
||||
{
|
||||
"ProjectLoadoutTemplateAsync(",
|
||||
"AetheriaClientState state",
|
||||
".Reactive<AetheriaRuntimeDaemonFrameDocument>()",
|
||||
"ProjectLoadoutTemplate(",
|
||||
"frame.Current?.Run ?? new AetheriaRuntimeRunCheckpointCommit()"
|
||||
"public static AetheriaRuntimeLoadoutTemplateCommit ProjectLoadoutTemplate(",
|
||||
"AetheriaRuntimeRunCheckpointCommit run,",
|
||||
"TryParseEntityKey(entityKey, out var zoneIndex, out var entityIndex)",
|
||||
"ProjectLoadoutTemplate(run, zoneIndex, entityIndex)",
|
||||
"ProjectEntityLoadout(entity, entities)"
|
||||
};
|
||||
var missingLoadoutSnapshotProjectorSymbols = requiredLoadoutSnapshotProjectorSymbols
|
||||
.Where(symbol => !loadoutSnapshotProjector.Contains(symbol, StringComparison.Ordinal))
|
||||
|
|
@ -17816,6 +17816,15 @@ static void RequireInventoryLoadoutSaveRequestAuthority(string root)
|
|||
string.Join(", ", missingLoadoutSnapshotProjectorSymbols));
|
||||
}
|
||||
|
||||
if (loadoutSnapshotProjector.Contains("ProjectLoadoutTemplateAsync(", StringComparison.Ordinal) ||
|
||||
loadoutSnapshotProjector.Contains("AetheriaClientState state", StringComparison.Ordinal) ||
|
||||
loadoutSnapshotProjector.Contains(".Reactive<AetheriaRuntimeDaemonFrameDocument>()", StringComparison.Ordinal) ||
|
||||
loadoutSnapshotProjector.Contains("frame.Current?.Run", StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Loadout snapshot composition must not own managed document sampling; InventoryPanel already caches the reactive daemon frame.");
|
||||
}
|
||||
|
||||
if (loadoutSnapshotProjector.Contains("state.Daemon.LatestFrame.LatestAsync()", StringComparison.Ordinal))
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
#nullable enable
|
||||
|
||||
|
|
@ -9,18 +8,6 @@ namespace GameCult.Aetheria.State.Verse
|
|||
{
|
||||
public static class AetheriaRuntimeLoadoutSnapshotProjector
|
||||
{
|
||||
public static Task<AetheriaRuntimeLoadoutTemplateCommit> ProjectLoadoutTemplateAsync(
|
||||
AetheriaClientState state,
|
||||
string entityKey)
|
||||
{
|
||||
if (state == null) throw new ArgumentNullException(nameof(state));
|
||||
|
||||
using var frame = state.Reactive<AetheriaRuntimeDaemonFrameDocument>();
|
||||
return Task.FromResult(ProjectLoadoutTemplate(
|
||||
frame.Current?.Run ?? new AetheriaRuntimeRunCheckpointCommit(),
|
||||
entityKey ?? ""));
|
||||
}
|
||||
|
||||
public static AetheriaRuntimeLoadoutTemplateCommit ProjectLoadoutTemplate(
|
||||
AetheriaRuntimeRunCheckpointCommit run,
|
||||
string entityKey)
|
||||
|
|
|
|||
Loading…
Reference in a new issue