Table of Contents

Method LoadAllBaseMirrorsAsync

Namespace
GrindFest.Content
Assembly
GrindFest.dll

LoadAllBaseMirrorsAsync(CancellationToken)

Reads every base mirror now instead of on first use, and returns how many definitions that added.

This deliberately gives up half of D5's lazy-per-kind trade. The reason is where the lazy read lands: the first bake of each kind happens during normal play (a loot roll, a monster spawn, a skill), so a ~3 MB JSON parse and its object graph arrive at an arbitrary moment in the middle of gameplay, for a cost nobody scheduled and no one can see. Paying it once during the content stage instead moves it to a defined place in the boot, in front of the loading screen, and makes every later definition read a pure memory lookup. The measured cost is logged by the caller - if it ever stops being small, this is the line to re-examine.

Idempotent, and it shares GrindFest.Content.ContentDB._loadedMirrorKinds with the lazy path, so a kind read here is never read again there.

public static Task<int> LoadAllBaseMirrorsAsync(CancellationToken ct = default)

Parameters

ct CancellationToken

Returns

Task<int>