feat(Database) Direct database/Throne links now work in the database. Added a Detailed/Plain view button

This commit is contained in:
2022-04-03 20:09:21 -04:00
parent 8584570a1e
commit 28087b58d9
28 changed files with 1123 additions and 296 deletions
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
+13 -15
View File
@@ -26,21 +26,19 @@
</div>
<div class="dialogContent">
<CascadingValue Value="@entity">
<CascadingValue Value="@refresh">
<EntityVanguardAddedComponent ></EntityVanguardAddedComponent>
<EntityInfoComponent ></EntityInfoComponent>
<EntityVanguardsComponent ></EntityVanguardsComponent>
<EntityProductionComponent ></EntityProductionComponent>
<EntityStatsComponent ></EntityStatsComponent>
<EntityMechanicsComponent ></EntityMechanicsComponent>
<EntityPassivesComponent ></EntityPassivesComponent>
<EntityPyreSpellsComponent ></EntityPyreSpellsComponent>
<EntityUpgradesComponent ></EntityUpgradesComponent>
<EntityWeaponsComponent ></EntityWeaponsComponent>
<EntityAbilitiesComponent ></EntityAbilitiesComponent>
</CascadingValue>
</CascadingValue>
<CascadingValue Value="@entity">
<EntityVanguardAddedComponent />
<EntityInfoComponent />
<EntityVanguardsComponent />
<EntityProductionComponent />
<EntityStatsComponent />
<EntityMechanicsComponent />
<EntityPassivesComponent />
<EntityPyreSpellsComponent />
<EntityUpgradesComponent />
<EntityWeaponsComponent />
<EntityAbilitiesComponent />
</CascadingValue>
</div>
<div class="dialogFooter"></div>
+25 -8
View File
@@ -4,17 +4,23 @@
@implements IDisposable
@inject IEntityDisplayService entityDisplayService
<LayoutLargeContentComponent>
<WebsiteTitleComponent>Database</WebsiteTitleComponent>
<PaperComponent>
<FormDisplayComponent Label="Patch">
<Display>
Game Patch: @EntityModel.GameVersion
</Display>
</FormDisplayComponent>
<FormDisplayComponent Label="Patch">
<Display>
Game Patch: @EntityModel.GameVersion
</Display>
</FormDisplayComponent>
</PaperComponent>
<div style="margin-left: 8px">
<ButtonGroupComponent OnClick="((choice => { entityDisplayService.SetDisplayType(choice); }))" Choice="@entityDisplayService.GetDisplayType()" Choices="@entityDisplayService.DefaultChoices()"></ButtonGroupComponent>
</div>
<PaperComponent>
<EntityFilterComponent></EntityFilterComponent>
@@ -22,7 +28,9 @@
<div class="databaseItems">
@foreach (var entity in searches) {
<CascadingValue Value="entity">
<EntityViewComponent></EntityViewComponent>
<CascadingValue Value="@entityDisplayService.GetDisplayType()">
<EntityViewComponent></EntityViewComponent>
</CascadingValue>
</CascadingValue>
}
</div>
@@ -91,6 +99,13 @@
border-bottom: 4px solid var(--accent);
padding: 4px;
}
.databaseInfoContainer {
display: flex;
gap: 24px;
}
</style>
@@ -118,10 +133,12 @@
RefreshFactionSearch();
EntityFilterService.Subscribe(OnChange);
entityDisplayService.Subscribe(StateHasChanged);
}
void IDisposable.Dispose() {
EntityFilterService.Subscribe(OnChange);
EntityFilterService.Unsubscribe(OnChange);
entityDisplayService.Unsubscribe(StateHasChanged);
}
void OnChange(EntityFilterEvent filterEntityEvent) {
@@ -0,0 +1,78 @@
@layout PageLayout
@page "/database/{text}"
@inject IEntityDisplayService entityDisplayService
@implements IDisposable
<LayoutLargeContentComponent>
<PaperComponent>
<FormDisplayComponent Label="Patch">
<Display>
Game Patch: @EntityModel.GameVersion
</Display>
</FormDisplayComponent>
</PaperComponent>
<div style="margin-left: 8px">
<ButtonGroupComponent OnClick="((choice => { entityDisplayService.SetDisplayType(choice); }))" Choice="@entityDisplayService.GetDisplayType()" Choices="@entityDisplayService.DefaultChoices()"></ButtonGroupComponent>
</div>
@if (entity == null)
{
<div>Invalid entity name entered: @Text</div>
<div>No such entity. Did you mean <b>"Throne"</b>?</div>
}
else
{
<PaperComponent>
<CascadingValue Value="entity">
<CascadingValue Value="@entityDisplayService.GetDisplayType()">
<EntityViewComponent></EntityViewComponent>
</CascadingValue>
</CascadingValue>
</PaperComponent>
}
</LayoutLargeContentComponent>
<style>
.databaseInfoContainer {
display: flex;
gap: 24px;
}
</style>
@code {
[Parameter]
public string? Text { get; set; }
private EntityModel? entity = null;
protected override void OnInitialized()
{
entityDisplayService.Subscribe(StateHasChanged);
foreach (var e in DATA.Get().Values)
{
if (e.Info().Name.Equals(Text))
{
entity = e;
return;
}
}
}
void IDisposable.Dispose() {
entityDisplayService.Unsubscribe(StateHasChanged);
}
}
@@ -3,22 +3,19 @@
<div class="enititiesContainer @isVanguard">
<EntityHeaderComponent></EntityHeaderComponent>
<CascadingValue Value="@Entity">
<div class="entityPartsContainer">
<EntityVanguardAddedComponent></EntityVanguardAddedComponent>
<EntityInfoComponent></EntityInfoComponent>
<EntityVanguardsComponent></EntityVanguardsComponent>
<EntityProductionComponent></EntityProductionComponent>
<EntityStatsComponent></EntityStatsComponent>
<EntityMechanicsComponent></EntityMechanicsComponent>
<EntityPassivesComponent></EntityPassivesComponent>
<EntityPyreSpellsComponent></EntityPyreSpellsComponent>
<EntityUpgradesComponent></EntityUpgradesComponent>
<EntityWeaponsComponent></EntityWeaponsComponent>
<EntityAbilitiesComponent></EntityAbilitiesComponent>
</div>
</CascadingValue>
<div class="entityPartsContainer">
<EntityVanguardAddedComponent></EntityVanguardAddedComponent>
<EntityInfoComponent></EntityInfoComponent>
<EntityVanguardsComponent></EntityVanguardsComponent>
<EntityProductionComponent></EntityProductionComponent>
<EntityStatsComponent></EntityStatsComponent>
<EntityMechanicsComponent></EntityMechanicsComponent>
<EntityPassivesComponent></EntityPassivesComponent>
<EntityPyreSpellsComponent></EntityPyreSpellsComponent>
<EntityUpgradesComponent></EntityUpgradesComponent>
<EntityWeaponsComponent></EntityWeaponsComponent>
<EntityAbilitiesComponent></EntityAbilitiesComponent>
</div>
</div>
}
@@ -52,4 +49,7 @@
@code {
[CascadingParameter]
public EntityModel? Entity { get; set; }
[CascadingParameter]
public string? StyleType { get; set; }
}
@@ -1,5 +1,6 @@
@if (Entity.IdAbilities().Count > 0) {
<EntityDisplayComponent Title="Abilities">
@if (StyleType.Equals("Plain"))
{
@foreach (var idAbility in Entity.IdAbilities()) {
var spell = EntityModel.Get(idAbility.Id);
@@ -8,15 +9,15 @@
<div>
<div>
<b>Name:</b> <EntityLabelComponent EntityId="@spell.DataType"/>
<b>Ability Name:</b> @spell.Info().Name
</div>
<div>
<b>Description:</b> @((MarkupString)info.Description)
<b>- Description:</b> @((MarkupString)info.Description)
</div>
@if (!info.Notes.Trim().Equals("")) {
<div>
<b>Notes:</b> @((MarkupString)info.Notes)
<b>- Notes:</b> @((MarkupString)info.Notes)
</div>
}
@@ -24,24 +25,73 @@
@if (production != null) {
if (production.Energy != 0) {
<div>
<b> Energy: </b> @production.Energy
<b>- Energy: </b> @production.Energy
</div>
}
if (production.BuildTime != 0) {
<div>
<b> BuildTime: </b> @production.BuildTime
<b>- BuildTime: </b> @production.BuildTime
</div>
}
if (production.Cooldown != 0) {
<div>
<b> Cooldown: </b> @production.Cooldown
<b>- Cooldown: </b> @production.Cooldown
</div>
}
}
</div>
</div>
}
</EntityDisplayComponent>
}
else
{
<EntityDisplayComponent Title="Abilities">
@foreach (var idAbility in Entity.IdAbilities()) {
var spell = EntityModel.Get(idAbility.Id);
var info = spell.Info();
var production = spell.Production();
<div>
<div>
<b>Name:</b> <EntityLabelComponent EntityId="@spell.DataType"/>
</div>
<div>
<b>Description:</b> @((MarkupString)info.Description)
</div>
@if (!info.Notes.Trim().Equals("")) {
<div>
<b>Notes:</b> @((MarkupString)info.Notes)
</div>
}
<div>
@if (production != null) {
if (production.Energy != 0) {
<div>
<b> Energy: </b> @production.Energy
</div>
}
if (production.BuildTime != 0) {
<div>
<b> BuildTime: </b> @production.BuildTime
</div>
}
if (production.Cooldown != 0) {
<div>
<b> Cooldown: </b> @production.Cooldown
</div>
}
}
</div>
</div>
}
</EntityDisplayComponent>
}
}
@@ -50,5 +100,8 @@
[CascadingParameter]
public EntityModel? Entity { get; set; }
[CascadingParameter]
public string StyleType { get; set; } = "Detailed";
}
@@ -1,18 +1,30 @@
<div class="entityHeader">
<div class="entityHeaderText">
@Entity.Info().Name
@if (StyleType.Equals("Plain"))
{
<div><b>@Entity?.Info().Name</b>
@if (Entity?.Info().Descriptive != DescriptiveType.None)
{
<span>, @Entity?.Info().Descriptive.Replace("_", " ")</span>
}
</div>
}
else
{
<div class="entityHeader">
<div class="entityHeaderText">
@Entity?.Info().Name
</div>
<div style="font-size:1.4rem;">
<b>@Entity?.EntityType.Replace("_", " ")</b>
@if (Entity?.Info().Descriptive != DescriptiveType.None)
{
<span>
<b>:</b> @Entity.Info().Descriptive.Replace("_", " ")
</span>
}
</div>
</div>
<div style="font-size:1.4rem;">
<b>@Entity.EntityType.Replace("_", " ")</b>
@if (Entity.Info().Descriptive != DescriptiveType.None) {
<span>
<b>:</b> @Entity.Info().Descriptive.Replace("_", " ")
</span>
}
</div>
</div>
<style>
<style>
.entityHeader {
display: flex;
flex-direction: row;
@@ -36,11 +48,15 @@
}
}
</style>
}
@code {
[CascadingParameter]
public EntityModel? Entity { get; set; }
[CascadingParameter]
public string StyleType { get; set; } = "Detailed";
}
@@ -1,4 +1,6 @@
<EntityDisplayComponent Title="Info">
@if (StyleType.Equals("Plain"))
{
@if (Entity.Info().Description != "") {
<div>
<b>Description:</b> @((MarkupString)Entity.Info().Description)
@@ -6,9 +8,9 @@
}
@if (Entity.Info().Notes != "") {
<div>
<b>Notes:</b> @((MarkupString)Entity.Info().Notes)
</div>
<div>
<b>Notes:</b> @((MarkupString)Entity.Info().Notes)
</div>
}
@@ -40,25 +42,76 @@
</div>
}
</div>
</EntityDisplayComponent>
<style>
.infoDisplayContainer {
display: flex;
gap: 32px;
}
@@media only screen and (max-width: 1025px) {
.infoDisplayContainer {
flex-direction: column;
gap: 4px;
}
else
{
<EntityDisplayComponent Title="Info">
@if (Entity.Info().Description != "") {
<div>
<b>Description:</b> @((MarkupString)Entity.Info().Description)
</div>
}
}
</style>
@if (Entity.Info().Notes != "") {
<div>
<b>Notes:</b> @((MarkupString)Entity.Info().Notes)
</div>
}
<div class="infoDisplayContainer">
<div>
@if (Entity.Faction() != null) {
<div>
<b>Faction:</b> @Entity.Faction().Faction
</div>
}
@if (Entity.Tier() != null) {
<div>
<b>Tier:</b> @Entity.Tier().Tier
</div>
}
</div>
@if (Entity.Hotkey() != null) {
<div>
<div>
<b>Hotkey Group:</b> @Entity.Hotkey().HotkeyGroup
</div>
<div>
<b>Hotkey:</b> @Entity.Hotkey().Hotkey
</div>
<div>
<b>Hold Space:</b> @(Entity.Hotkey().HoldSpace ? "Yes" : "No")
</div>
</div>
}
</div>
</EntityDisplayComponent>
<style>
.infoDisplayContainer {
display: flex;
gap: 32px;
}
@@media only screen and (max-width: 1025px) {
.infoDisplayContainer {
flex-direction: column;
gap: 4px;
}
}
</style>
}
@code {
[CascadingParameter]
public EntityModel? Entity { get; set; }
[CascadingParameter]
public string StyleType { get; set; } = "Detailed";
}
@@ -23,5 +23,8 @@
[CascadingParameter]
public EntityModel? Entity { get; set; }
[CascadingParameter]
public string StyleType { get; set; } = "Detailed";
}
@@ -1,5 +1,6 @@
@if (Entity.IdPassives().Count > 0) {
<EntityDisplayComponent Title="Passives">
@if (StyleType.Equals("Plain"))
{
@foreach (var idPassive in Entity.IdPassives()) {
var passive = EntityModel.Get(idPassive.Id);
@@ -9,16 +10,16 @@
<div>
<div>
<b>Name:</b> <EntityLabelComponent EntityId="@passive.DataType"/>
<b>Name:</b> @info.Name
</div>
<div style="max-width: 600px;">
<b>Description:</b> @((MarkupString)info.Description)
<div>
<b>- Description:</b> @((MarkupString)info.Description)
</div>
@if (!info.Notes.Trim().Equals("")) {
<div style="max-width: 600px;">
<b>Description:</b> @((MarkupString)info.Notes)
<div>
<b>- Description:</b> @((MarkupString)info.Notes)
</div>
}
</div>
@@ -27,18 +28,64 @@
<div>
@if (production.Pyre != 0) {
<div>
<b>Pyre:</b> @production.Pyre
<b>- Pyre:</b> @production.Pyre
</div>
}
@if (production.Cooldown != 0) {
<div>
<b>Cooldown:</b> @production.Cooldown.ToString()s
<b>- Cooldown:</b> @production.Cooldown.ToString()s
</div>
}
</div>
}
}
</EntityDisplayComponent>
}
else
{
<EntityDisplayComponent Title="Passives">
@foreach (var idPassive in Entity.IdPassives()) {
var passive = EntityModel.Get(idPassive.Id);
var info = passive.Info();
var production = passive.Production();
<div>
<div>
<b>Name:</b> <EntityLabelComponent EntityId="@passive.DataType"/>
</div>
<div>
<b>Description:</b> @((MarkupString)info.Description)
</div>
@if (!info.Notes.Trim().Equals("")) {
<div>
<b>Description:</b> @((MarkupString)info.Notes)
</div>
}
</div>
@if (production != null) {
<div>
@if (production.Pyre != 0) {
<div>
<b>Pyre:</b> @production.Pyre
</div>
}
@if (production.Cooldown != 0) {
<div>
<b>Cooldown:</b> @production.Cooldown.ToString()s
</div>
}
</div>
}
}
</EntityDisplayComponent>
}
}
@@ -47,4 +94,8 @@
[CascadingParameter]
public EntityModel? Entity { get; set; }
[CascadingParameter]
public string StyleType { get; set; } = "Detailed";
}
@@ -1,79 +1,157 @@
@if (@Production != null || Supply != null || Requirements.Count > 0) {
<EntityDisplayComponent Title="Production">
<div class="ProductionContainer">
@if (Production != null || Supply != null || Requirements.Count > 0) {
@if (StyleType.Equals("Plain"))
{
@if (Requirements.Count() > 0) {
<div>
@foreach (var requirement in Requirements) {
<div>
<div>
@foreach (var requirement in Requirements)
{
var replaced = DATA.Get()[requirement.DataType];
<div>
<span>
<b>@requirement.Requirement.Replace("_", " "):</b> <EntityLabelComponent EntityId="@requirement.DataType"/>
</span>
</div>
}
</div>
}
<span>
<b>@requirement.Requirement.Replace("_", " "):</b> @replaced.Info().Name
</span>
</div>
}
</div>
}
@if (Production != null && (!Production.Alloy.Equals(0)
|| !Production.Ether.Equals(0)
|| !Production.BuildTime.Equals(0)
|| !Production.Cooldown.Equals(0))) {
<div>
@if (!Production.Alloy.Equals(0)) {
<div>
<b>Alloy:</b> @Production.Alloy
</div>
}
@if (!Production.Ether.Equals(0)) {
<div>
<b>Ether:</b> @Production.Ether
</div>
}
@if (!Production.Pyre.Equals(0)) {
<div>
<b>Pyre:</b> @Production.Pyre
</div>
}
@if (Production != null && (!Production.Alloy.Equals(0)
|| !Production.Ether.Equals(0)
|| !Production.BuildTime.Equals(0)
|| !Production.Cooldown.Equals(0))) {
<div>
@if (!Production.Alloy.Equals(0)) {
<div>
<b>Alloy:</b> @Production.Alloy
</div>
}
@if (!Production.Ether.Equals(0)) {
<div>
<b>Ether:</b> @Production.Ether
</div>
}
@if (!Production.Pyre.Equals(0)) {
<div>
<b>Pyre:</b> @Production.Pyre
</div>
}
@if (!Production.BuildTime.Equals(0)) {
<div>
<b>Build Time:</b> @Production.BuildTime.ToString()s
</div>
}
@if (!Production.BuildTime.Equals(0)) {
<div>
<b>Build Time:</b> @Production.BuildTime.ToString()s
</div>
}
@if (!Production.Energy.Equals(0)) {
<div>
<b>Energy:</b> @Production.Energy
</div>
}
@if (!Production.Energy.Equals(0)) {
<div>
<b>Energy:</b> @Production.Energy
</div>
}
@if (!Production.Cooldown.Equals(0)) {
<div>
<b>Cooldown:</b> @Production.Cooldown.ToString()s
</div>
}
</div>
}
@if (Supply != null) {
<div>
@if (!Supply.Grants.Equals(0)) {
<div>
<b>Grants:</b> @Supply.Grants
</div>
}
@if (!Supply.Takes.Equals(0)) {
<div>
<b>Takes:</b> @Supply.Takes Supply
</div>
}
</div>
}
</div>
</EntityDisplayComponent>
}
@if (!Production.Cooldown.Equals(0)) {
<div>
<b>Cooldown:</b> @Production.Cooldown.ToString()s
</div>
}
</div>
}
@if (Supply != null) {
<div>
@if (!Supply.Grants.Equals(0)) {
<div>
<b>Grants:</b> @Supply.Grants
</div>
}
@if (!Supply.Takes.Equals(0)) {
<div>
<b>Takes:</b> @Supply.Takes Supply
</div>
}
</div>
}
}
<style>
else
{
<EntityDisplayComponent Title="Production">
<div class="ProductionContainer">
@if (Requirements.Count() > 0) {
<div>
@foreach (var requirement in Requirements) {
<div>
<span>
<b>@requirement.Requirement.Replace("_", " "):</b> <EntityLabelComponent EntityId="@requirement.DataType"/>
</span>
</div>
}
</div>
}
@if (Production != null && (!Production.Alloy.Equals(0)
|| !Production.Ether.Equals(0)
|| !Production.BuildTime.Equals(0)
|| !Production.Cooldown.Equals(0))) {
<div>
@if (!Production.Alloy.Equals(0)) {
<div>
<b>Alloy:</b> @Production.Alloy
</div>
}
@if (!Production.Ether.Equals(0)) {
<div>
<b>Ether:</b> @Production.Ether
</div>
}
@if (!Production.Pyre.Equals(0)) {
<div>
<b>Pyre:</b> @Production.Pyre
</div>
}
@if (!Production.BuildTime.Equals(0)) {
<div>
<b>Build Time:</b> @Production.BuildTime.ToString()s
</div>
}
@if (!Production.Energy.Equals(0)) {
<div>
<b>Energy:</b> @Production.Energy
</div>
}
@if (!Production.Cooldown.Equals(0)) {
<div>
<b>Cooldown:</b> @Production.Cooldown.ToString()s
</div>
}
</div>
}
@if (Supply != null) {
<div>
@if (!Supply.Grants.Equals(0)) {
<div>
<b>Grants:</b> @Supply.Grants
</div>
}
@if (!Supply.Takes.Equals(0)) {
<div>
<b>Takes:</b> @Supply.Takes Supply
</div>
}
</div>
}
</div>
</EntityDisplayComponent>
<style>
.ProductionContainer {
display: flex;
gap: 32px;
@@ -87,11 +165,18 @@
}
</style>
}
}
@code {
[CascadingParameter]
public EntityModel? Entity { get; set; }
[CascadingParameter]
public string StyleType { get; set; } = "Detailed";
private EntityProductionModel Production => Entity.Production();
private List<EntityRequirementModel> Requirements => Entity.Requirements();
@@ -1,5 +1,7 @@
@if (Entity.IdPyreSpells().Count > 0) {
<EntityDisplayComponent Title="Pyre Spells">
@if (Entity.IdPyreSpells().Count > 0)
{
@if (StyleType.Equals("Plain"))
{
@foreach (var pyreSpell in Entity.IdPyreSpells()) {
var spell = EntityModel.Get(pyreSpell.Id);
@@ -8,30 +10,68 @@
<div>
<div>
<b>Name:</b> <EntityLabelComponent EntityId="@spell.DataType"/>
<b>Spell Name:</b> @spell.Info().Name
</div>
<div>
<b>Description:</b> @((MarkupString)info.Description)
<b>- Description:</b> @((MarkupString)info.Description)
</div>
<div>
@if (production != null) {
if (production.Pyre != 0) {
<b> Pyre: </b>
<b>- Pyre: </b>
@production.Pyre
}
if (production.BuildTime != 0) {
<b> BuildTime: </b>
<b>- BuildTime: </b>
@production.BuildTime
}
if (production.Cooldown != 0) {
<b> Cooldown: </b>
<b>- Cooldown: </b>
@production.Cooldown
}
}
</div>
</div>
}
</EntityDisplayComponent>
}
else
{
<EntityDisplayComponent Title="Pyre Spells">
@foreach (var pyreSpell in Entity.IdPyreSpells()) {
var spell = EntityModel.Get(pyreSpell.Id);
var info = spell.Info();
var production = spell.Production();
<div>
<div>
<b>Name:</b> <EntityLabelComponent EntityId="@spell.DataType"/>
</div>
<div>
<b>Description:</b> @((MarkupString)info.Description)
</div>
<div>
@if (production != null) {
if (production.Pyre != 0) {
<b> Pyre: </b>
@production.Pyre
}
if (production.BuildTime != 0) {
<b> BuildTime: </b>
@production.BuildTime
}
if (production.Cooldown != 0) {
<b> Cooldown: </b>
@production.Cooldown
}
}
</div>
</div>
}
</EntityDisplayComponent>
}
}
@@ -40,4 +80,8 @@
[CascadingParameter]
public EntityModel? Entity { get; set; }
[CascadingParameter]
public string StyleType { get; set; } = "Detailed";
}
@@ -1,66 +1,125 @@
@if (Vitality != null || Movement != null) {
<EntityDisplayComponent Title="Stats">
<div class="statContainer">
@if (Vitality != null) {
<div>
@if (!Vitality.DefenseLayer.Equals(0)) {
<div>
<b>Shield:</b> @Vitality.DefenseLayer
</div>
}
@if (!Vitality.Health.Equals(0)) {
<div>
<b>Health:</b> @Vitality.Health
</div>
}
@if (!Vitality.Energy.Equals(0)) {
<div>
<b>Energy:</b> @Vitality.Energy
</div>
}
@if (Vitality.Armor != "") {
<div>
<b>Armor:</b> @Vitality.Armor
</div>
}
@if (Vitality.IsEtheric) {
<div>
<b> + Etheric</b>
</div>
}
@if (Vitality.IsStructure) {
<div>
<b> + Structure</b>
</div>
}
</div>
}
@if (Movement != null) {
<div>
@if (!Movement.Speed.Equals(0)) {
<div>
<b>Speed:</b> @Movement.Speed
</div>
}
else {
<div>
<b>Speed:</b> Immobile
</div>
}
@if (StyleType.Equals("Plain"))
{
@if (Vitality != null) {
<div>
<b>Move Type:</b> @Movement.Movement
</div>
</div>
}
</div>
</EntityDisplayComponent>
}
@if (!Vitality.DefenseLayer.Equals(0)) {
<div>
<b>Shield:</b> @Vitality.DefenseLayer
</div>
}
@if (!Vitality.Health.Equals(0)) {
<div>
<b>Health:</b> @Vitality.Health
</div>
}
@if (!Vitality.Energy.Equals(0)) {
<div>
<b>Energy:</b> @Vitality.Energy
</div>
}
@if (Vitality.Armor != "") {
<div>
<b>Armor:</b> @Vitality.Armor
</div>
}
<style>
@if (Vitality.IsEtheric) {
<div>
<b> + Etheric</b>
</div>
}
@if (Vitality.IsStructure) {
<div>
<b> + Structure</b>
</div>
}
</div>
}
@if (Movement != null) {
<div>
@if (!Movement.Speed.Equals(0)) {
<div>
<b>Speed:</b> @Movement.Speed
</div>
}
else {
<div>
<b>Speed:</b> Immobile
</div>
}
<div>
<b>Move Type:</b> @Movement.Movement
</div>
</div>
}
}
else
{
<EntityDisplayComponent Title="Stats">
<div class="statContainer">
@if (Vitality != null) {
<div>
@if (!Vitality.DefenseLayer.Equals(0)) {
<div>
<b>Shield:</b> @Vitality.DefenseLayer
</div>
}
@if (!Vitality.Health.Equals(0)) {
<div>
<b>Health:</b> @Vitality.Health
</div>
}
@if (!Vitality.Energy.Equals(0)) {
<div>
<b>Energy:</b> @Vitality.Energy
</div>
}
@if (Vitality.Armor != "") {
<div>
<b>Armor:</b> @Vitality.Armor
</div>
}
@if (Vitality.IsEtheric) {
<div>
<b> + Etheric</b>
</div>
}
@if (Vitality.IsStructure) {
<div>
<b> + Structure</b>
</div>
}
</div>
}
@if (Movement != null) {
<div>
@if (!Movement.Speed.Equals(0)) {
<div>
<b>Speed:</b> @Movement.Speed
</div>
}
else {
<div>
<b>Speed:</b> Immobile
</div>
}
<div>
<b>Move Type:</b> @Movement.Movement
</div>
</div>
}
</div>
</EntityDisplayComponent>
<style>
.statContainer {
display: flex;
gap: 32px;
@@ -74,10 +133,20 @@
}
</style>
}
}
@code {
[CascadingParameter]
public EntityModel? Entity { get; set; }
[CascadingParameter]
public string StyleType { get; set; } = "Detailed";
private EntityVitalityModel Vitality => Entity.Vitality();
private EntityMovementModel Movement => Entity.Movement();
}
@@ -1,22 +1,39 @@
@if (Entity.IdUpgrades().Count > 0) {
<EntityDisplayComponent Title="Upgrades">
<div class="upgradesContainer">
@foreach (var upgradeId in Entity.IdUpgrades()) {
var entity = EntityModel.Get(upgradeId.Id);
@if (StyleType.Equals("Plain"))
{
@foreach (var upgradeId in Entity.IdUpgrades()) {
var entity = EntityModel.Get(upgradeId.Id);
<div>
<div>
<div>
<b>Name:</b> <EntityLabelComponent EntityId="@entity.DataType"/>
</div>
<div>
<b>Description:</b> @entity.Info().Description
</div>
<b>Upgrade Name:</b> @entity.Info().Name
</div>
}
</div>
</EntityDisplayComponent>
}
<style>
<div>
<b>- Description:</b> @entity.Info().Description
</div>
</div>
}
}
else
{
<EntityDisplayComponent Title="Upgrades">
<div class="upgradesContainer">
@foreach (var upgradeId in Entity.IdUpgrades()) {
var entity = EntityModel.Get(upgradeId.Id);
<div>
<div>
<b>Name:</b> <EntityLabelComponent EntityId="@entity.DataType"/>
</div>
<div>
<b>Description:</b> @entity.Info().Description
</div>
</div>
}
</div>
</EntityDisplayComponent>
<style>
.upgradesContainer {
display: flex;
gap: 32px;
@@ -29,10 +46,18 @@
}
}
</style>
}
}
@code {
[CascadingParameter]
public EntityModel? Entity { get; set; }
[CascadingParameter]
public string StyleType { get; set; } = "Detailed";
}
@@ -1,31 +1,46 @@
@{
var vanguard = Entity.VanguardAdded();
var isNull = Entity.VanguardAdded() == null ? "null" : "not null";
}
@if (vanguard != null) {
var immortalId = Entity.VanguardAdded().ImmortalId;
@if (Vanguard != null) {
var immortalId = Vanguard.ImmortalId;
var immortal = DATA.Get()[immortalId];
var replaced = DATA.Get()[Vanguard.ReplaceId];
<EntityDisplayComponent Title="Vanguard">
@if (StyleType.Equals("Plain"))
{
<div>
<div>
<b>Immortal:</b> <EntityLabelComponent EntityId="@immortal.DataType"/>
</div>
@if (!Entity.VanguardAdded().ReplaceId.Equals("")) {
<div>
<b>Replaces:</b> <EntityLabelComponent EntityId="@Entity.VanguardAdded().ReplaceId"></EntityLabelComponent>
</div>
}
<b>Immortal:</b> @immortal.Info().Name
</div>
</EntityDisplayComponent>
@if (!Vanguard.ReplaceId.Equals("")) {
<div>
<b>Replaces:</b> @replaced.Info().Name
</div>
}
}
else
{
<EntityDisplayComponent Title="Vanguard">
<div>
<div>
<b>Immortal:</b> <EntityLabelComponent EntityId="@immortal.DataType"/>
</div>
@if (!Vanguard.ReplaceId.Equals("")) {
<div>
<b>Replaces:</b> <EntityLabelComponent EntityId="@Vanguard.ReplaceId"></EntityLabelComponent>
</div>
}
</div>
</EntityDisplayComponent>
}
}
@code {
[CascadingParameter]
public EntityModel? Entity { get; set; }
private EntityVanguardAddedModel? Vanguard => Entity?.VanguardAdded();
[CascadingParameter]
public string StyleType { get; set; } = "Detailed";
}
@@ -1,27 +1,60 @@
@if (Entity.IdVanguards().Count > 0) {
<EntityDisplayComponent Title="Vanguards">
@if (StyleType.Equals("Plain"))
{
@foreach (var data in Entity.IdVanguards()) {
var entity = EntityModel.Get(data.Id);
var requirements = entity.Requirements();
var vanguard = entity.VanguardAdded();
var vanguardAdded = entity.VanguardAdded();
var replaced = DATA.Get()[vanguardAdded.ReplaceId];
var immortal = DATA.Get()[vanguardAdded.ImmortalId];
var productionBuilding = (from building in requirements
where building.Requirement == RequirementType.Production_Building
select building).First().DataType;
<div>
<div>
<b>Name:</b> <EntityLabelComponent EntityId="@entity.DataType"/>
<b>Name:</b> @entity.Info().Name
</div>
<div>
<b>Replaces:</b> <EntityLabelComponent EntityId="@vanguard.ReplaceId"/>
<b>- Replaces:</b> @replaced.Info().Name
</div>
<div>
<b>Built From:</b> <EntityLabelComponent EntityId="@productionBuilding"/>
<b>- Built From:</b> @immortal.Info().Name
</div>
</div>
}
</EntityDisplayComponent>
}
else
{
<EntityDisplayComponent Title="Vanguards">
@foreach (var data in Entity.IdVanguards()) {
var entity = EntityModel.Get(data.Id);
var requirements = entity.Requirements();
var vanguard = entity.VanguardAdded();
var productionBuilding = (from building in requirements
where building.Requirement == RequirementType.Production_Building
select building).First().DataType;
<div>
<div>
<b>Name:</b> <EntityLabelComponent EntityId="@entity.DataType"/>
</div>
<div>
<b>Replaces:</b> <EntityLabelComponent EntityId="@vanguard.ReplaceId"/>
</div>
<div>
<b>Built From:</b> <EntityLabelComponent EntityId="@productionBuilding"/>
</div>
</div>
}
</EntityDisplayComponent>
}
}
@code {
@@ -29,4 +62,8 @@
[CascadingParameter]
public EntityModel? Entity { get; set; }
[CascadingParameter]
public string StyleType { get; set; } = "Detailed";
}
@@ -1,34 +1,146 @@
@if (Entity.Weapons().Count > 0) {
@if (Entity.Weapons().Count > 0)
{
@if (StyleType.Equals("Plain"))
{
int index = 0;
foreach (var data in Entity.Weapons())
{
index++;
<div>
<div>
<div class="damageContainer">
<div>
<b>Weapon @index</b>
</div>
<div>
<b>- Damage:</b> @data.Damage
</div>
@if (data.LightDamage != 0)
{
<div class="alternateDamage">
<i>- vs Light: @data.LightDamage</i>&nbsp;
</div>
}
@if (data.MediumDamage != 0)
{
<div class="alternateDamage">
<i>- vs Medium: @data.MediumDamage</i>&nbsp;
</div>
}
@if (data.HeavyDamage != 0)
{
<div class="alternateDamage">
<i>- vs Heavy: @data.HeavyDamage</i>&nbsp;
</div>
}
@if (data.EthericDamageBonus != 0)
{
<div class="alternateDamage">
<i>- vs Etheric +@data.EthericDamageBonus</i>&nbsp;
</div>
}
@if (data.StructureDamageBonus != 0)
{
<div class="alternateDamage">
<i>- vs Structure: +@data.StructureDamageBonus</i>&nbsp;
</div>
}
</div>
</div>
<div>
<b>- Range:</b> @data.Range
</div>
@if (data.SecondsBetweenAttacks > 0)
{
<div>
<b>- AttacksPerSecond:</b> @(1 / data.SecondsBetweenAttacks)
</div>
<div>
- (or <b>SecondsBetweenAttacks:</b> @data.SecondsBetweenAttacks)
</div>
}
else if (data.AttacksPerSecond > 0)
{
<div>
<b>- AttacksPerSecond:</b> @data.AttacksPerSecond
</div>
<div>
- (or <b>SecondsBetweenAttacks:</b> @(1 / data.AttacksPerSecond))
</div>
}
<div>
<b>- Targets:</b> @data.Targets
</div>
@if (data.AttacksPerSecond != 0)
{
<span>
<b>- DPS:</b> @(Math.Round(data.Damage * data.AttacksPerSecond))&nbsp;
</span>
@if (data.LightDamage != 0)
{
<span>
<i>- Light DPS: @(Math.Round(data.LightDamage * data.AttacksPerSecond))</i>&nbsp;
</span>
}
@if (data.MediumDamage != 0)
{
<span>
<i>- Medium DPS: @(Math.Round(data.MediumDamage * data.AttacksPerSecond))</i>&nbsp;
</span>
}
@if (data.HeavyDamage != 0)
{
<span>
<i>- Heavy DPS: @(Math.Round(data.HeavyDamage * data.AttacksPerSecond))</i>&nbsp;
</span>
}
}
</div>
}
}
else
{
<EntityDisplayComponent Title="Weapons">
<div class="weaponsContainer">
@foreach (var data in Entity.Weapons()) {
@foreach (var data in Entity.Weapons())
{
<div>
<div>
<div class="damageContainer">
<div>
<b>Damage:</b> @data.Damage
</div>
@if (data.LightDamage != 0) {
@if (data.LightDamage != 0)
{
<div class="alternateDamage">
<i>vs Light: @data.LightDamage</i>&nbsp;
</div>
}
@if (data.MediumDamage != 0) {
@if (data.MediumDamage != 0)
{
<div class="alternateDamage">
<i>vs Medium: @data.MediumDamage</i>&nbsp;
</div>
}
@if (data.HeavyDamage != 0) {
@if (data.HeavyDamage != 0)
{
<div class="alternateDamage">
<i>vs Heavy: @data.HeavyDamage</i>&nbsp;
</div>
}
@if (data.EthericDamageBonus != 0) {
@if (data.EthericDamageBonus != 0)
{
<div class="alternateDamage">
<i>vs Etheric +@data.EthericDamageBonus</i>&nbsp;
</div>
}
@if (data.StructureDamageBonus != 0) {
@if (data.StructureDamageBonus != 0)
{
<div class="alternateDamage">
<i>vs Structure: +@data.StructureDamageBonus</i>&nbsp;
</div>
@@ -38,7 +150,8 @@
<div>
<b>Range:</b> @data.Range
</div>
@if (data.SecondsBetweenAttacks > 0) {
@if (data.SecondsBetweenAttacks > 0)
{
<div>
<b>AttacksPerSecond:</b> @(1 / data.SecondsBetweenAttacks)
</div>
@@ -46,7 +159,8 @@
(or <b>SecondsBetweenAttacks:</b> @data.SecondsBetweenAttacks)
</div>
}
else if (data.AttacksPerSecond > 0) {
else if (data.AttacksPerSecond > 0)
{
<div>
<b>AttacksPerSecond:</b> @data.AttacksPerSecond
</div>
@@ -58,33 +172,36 @@
<div>
<b>Targets:</b> @data.Targets
</div>
@if (data.AttacksPerSecond != 0) {
<span>
@if (data.AttacksPerSecond != 0)
{
<div>
<b>DPS:</b> @(Math.Round(data.Damage * data.AttacksPerSecond))&nbsp;
</span>
@if (data.LightDamage != 0) {
<span>
<i>L: @(Math.Round(data.LightDamage * data.AttacksPerSecond))</i>&nbsp;
</span>
</div>
@if (data.LightDamage != 0)
{
<div>
<i>Light DPS: @(Math.Round(data.LightDamage * data.AttacksPerSecond))</i>&nbsp;
</div>
}
@if (data.MediumDamage != 0) {
<span>
<i>M: @(Math.Round(data.MediumDamage * data.AttacksPerSecond))</i>&nbsp;
</span>
@if (data.MediumDamage != 0)
{
<div>
<i>Medium DPS: @(Math.Round(data.MediumDamage * data.AttacksPerSecond))</i>&nbsp;
</div>
}
@if (data.HeavyDamage != 0) {
<span>
<i>H: @(Math.Round(data.HeavyDamage * data.AttacksPerSecond))</i>&nbsp;
</span>
@if (data.HeavyDamage != 0)
{
<div>
<i>Heavy DPS: @(Math.Round(data.HeavyDamage * data.AttacksPerSecond))</i>&nbsp;
</div>
}
}
</div>
}
</div>
</EntityDisplayComponent>
}
<style>
<style>
.weaponsContainer {
display: flex;
gap: 32px;
@@ -106,9 +223,16 @@
}
</style>
}
}
@code {
[CascadingParameter]
public EntityModel? Entity { get; set; }
[CascadingParameter]
public string StyleType { get; set; } = "Detailed";
}
@@ -4,7 +4,8 @@
@using Markdig
@implements IDisposable
@page "/docs"
@page "/docs/{text?}"
@if (!DocumentationService.IsLoaded())
{
@@ -119,6 +120,9 @@ else
@code {
[Parameter]
public string? Text { get; set; }
string selectedSection = "All";
protected override void OnInitialized()
+4
View File
@@ -13,6 +13,7 @@ using Services;
using Services.Immortal;
using Services.Website;
using Services.Development;
using IEntityDisplayService = Services.IEntityDisplayService;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.Logging.SetMinimumLevel(LogLevel.Warning);
@@ -33,6 +34,9 @@ builder.Services.AddSingleton<ITimingService, TimingService>();
builder.Services.AddSingleton<IMemoryTesterService, MemoryTesterService>();
builder.Services.AddSingleton<IEntityFilterService, EntityFilterService>();
builder.Services.AddSingleton<IEntityDisplayService, EntityDisplayService>();
builder.Services.AddSingleton(new HttpClient {
BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)
});
File diff suppressed because one or more lines are too long