Fan website of IMMORTAL: Gates of Pyre.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

57 lines
1.4 KiB

@implements IDisposable
<div style="overflow-y: scroll; width: 100%; overflow-x: hidden; height: 550px;">
@if (entity != null)
{
<EntityViewComponent Entity=Entity></EntityViewComponent>
}
</div>
@code {
private EntityModel entity = default!;
[Inject]
IKeyService KeyService { get; set; } = default!;
[Inject]
IImmortalSelectionService FilterService { get; set; } = default!;
[Inject]
IBuildOrderService BuildOrderService { get; set; } = default!;
protected override void OnInitialized()
{
KeyService.Subscribe(HandleClick);
BuildOrderService.Subscribe(OnBuildOrderChanged);
}
void IDisposable.Dispose()
{
KeyService.Unsubscribe(HandleClick);
BuildOrderService.Unsubscribe(OnBuildOrderChanged);
}
protected void HandleClick()
{
var hotkey = KeyService.GetHotkey();
var hotkeyGroup = KeyService.GetHotkeyGroup();
var isHoldSpace = KeyService.IsHoldingSpace();
var faction = FilterService.GetFactionType();
var immortal = FilterService.GetImmortalType();
var foundEntity = EntityModel.GetFrom(hotkey, hotkeyGroup, isHoldSpace, faction, immortal);
if (foundEntity != null)
{
entity = foundEntity;
StateHasChanged();
}
}
void OnBuildOrderChanged()
{
StateHasChanged();
}
}