@layout PageLayout @inherits BasePage @page "/database/{text}" @inject IEntityDisplayService EntityDisplayService @inject IVariableService VariableService @implements IDisposable Game Patch: @VariableService.Variables["GamePatch"]
@if (Text!.Trim().ToLower().Equals("walter")) { Unhandled Exception: EXCEPTION_MEMORY_SIZE_VIOLATION UNIT_WALTER too powerful to be displayed. This SHOULD NEVER HAPPEN! } else if (_entity == null) {
Invalid entity name entered: @Text
No such entity. Did you mean "Throne"?
} else { }
@code { [Parameter] public string? Text { get; set; } private EntityModel? _entity; protected override void OnInitialized() { EntityDisplayService.Subscribe(StateHasChanged); } protected override void OnParametersSet() { base.OnParametersSet(); base.OnInitialized(); FocusEntity(); } private void FocusEntity() { foreach (var e in DATA.Get().Values) { if (e.Info().Name.ToLower().Equals(Text!.ToLower())) { _entity = e; return; } } } void IDisposable.Dispose() { EntityDisplayService.Unsubscribe(StateHasChanged); } }