33 lines
1.2 KiB
C#
33 lines
1.2 KiB
C#
namespace NeonSprawl.Server.Game.Encounters;
|
|
|
|
/// <summary>Clears per-player encounter stores for dev Bruno/QA resets (NEO-108).</summary>
|
|
internal static class EncounterDevFixtureOperations
|
|
{
|
|
/// <summary>Removes progress, completion, and event rows for <paramref name="playerId"/> across catalog encounters.</summary>
|
|
public static void ClearPlayerEncounterState(
|
|
string playerId,
|
|
IEncounterDefinitionRegistry encounterRegistry,
|
|
IEncounterProgressStore progressStore,
|
|
IEncounterCompletionStore completionStore,
|
|
IEncounterCompleteEventStore eventStore)
|
|
{
|
|
foreach (var def in encounterRegistry.GetDefinitionsInIdOrder())
|
|
{
|
|
if (progressStore is InMemoryEncounterProgressStore inMemoryProgress)
|
|
{
|
|
inMemoryProgress.TryClear(playerId, def.Id);
|
|
}
|
|
|
|
if (completionStore is InMemoryEncounterCompletionStore inMemoryCompletion)
|
|
{
|
|
inMemoryCompletion.TryClear(playerId, def.Id);
|
|
}
|
|
|
|
if (eventStore is InMemoryEncounterCompleteEventStore inMemoryEvent)
|
|
{
|
|
inMemoryEvent.TryClear(playerId, def.Id);
|
|
}
|
|
}
|
|
}
|
|
}
|