7JDVMR6ZHAEGZX2OFCNTBJPHIIMTGWGVDEEYOMHTMKGHFTJOVZ4QC
public Unit<TUnit> GetCurrent<TResource, TUnit>()
where TResource : Resource<TUnit>
where TUnit : IUnit {
if (!ResourceCounter.TryGetValue(typeof(TResource), out var resourceContext)) {
resourceContext = new ResourceContext<TUnit>();
ResourceCounter.Add(typeof(TResource), resourceContext);
}
return ((ResourceContext<TUnit>)resourceContext).Current;
}