fix(Database) Fixed refresh bug. Fixed wrong data in database

This commit is contained in:
2022-04-03 16:17:32 -04:00
parent b5ea2ec833
commit 8584570a1e
24 changed files with 363 additions and 495 deletions
@@ -2,21 +2,23 @@
var isVanguard = Entity.VanguardAdded() != null ? " vanguard" : "";
<div class="enititiesContainer @isVanguard">
<EntityHeaderComponent Entity=Entity></EntityHeaderComponent>
<EntityHeaderComponent></EntityHeaderComponent>
<div class="entityPartsContainer">
<EntityVanguardAddedComponent Entity=Entity></EntityVanguardAddedComponent>
<EntityInfoComponent Entity=Entity></EntityInfoComponent>
<EntityVanguardsComponent Entity=Entity></EntityVanguardsComponent>
<EntityProductionComponent Entity=Entity></EntityProductionComponent>
<EntityStatsComponent Entity=Entity></EntityStatsComponent>
<EntityMechanicsComponent Entity=Entity></EntityMechanicsComponent>
<EntityPassivesComponent Entity=Entity></EntityPassivesComponent>
<EntityPyreSpellsComponent Entity=Entity></EntityPyreSpellsComponent>
<EntityUpgradesComponent Entity=Entity></EntityUpgradesComponent>
<EntityWeaponsComponent Entity=Entity></EntityWeaponsComponent>
<EntityAbilitiesComponent Entity=Entity></EntityAbilitiesComponent>
</div>
<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>
}
@@ -48,8 +50,6 @@
</style>
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
@@ -47,7 +47,8 @@
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
@@ -40,7 +40,7 @@
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
@@ -5,6 +5,13 @@
</div>
}
@if (Entity.Info().Notes != "") {
<div>
<b>Notes:</b> @((MarkupString)Entity.Info().Notes)
</div>
}
<div class="infoDisplayContainer">
<div>
@if (Entity.Faction() != null) {
@@ -51,7 +58,7 @@
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
@@ -21,7 +21,7 @@
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
@@ -44,7 +44,7 @@
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
@@ -1,76 +1,70 @@
@{
var production = Entity.Production();
var supply = Entity.Supply();
var requirements = Entity.Requirements();
}
@if (production != null || supply != null || requirements.Count > 0) {
@if (@Production != null || Supply != null || Requirements.Count > 0) {
<EntityDisplayComponent Title="Production">
<div class="productionContainer">
@if (requirements.Count() > 0) {
<div class="ProductionContainer">
@if (Requirements.Count() > 0) {
<div>
@foreach (var requirement in requirements) {
@foreach (var requirement in Requirements) {
<div>
<span>
<b>@requirement.Requirement.Replace("_", " "):</b> <EntityLabelComponent EntityId="@requirement.DataType"/>
<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))) {
@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)) {
@if (!Production.Alloy.Equals(0)) {
<div>
<b>Alloy:</b> @production.Alloy
<b>Alloy:</b> @Production.Alloy
</div>
}
@if (!production.Ether.Equals(0)) {
@if (!Production.Ether.Equals(0)) {
<div>
<b>Ether:</b> @production.Ether
<b>Ether:</b> @Production.Ether
</div>
}
@if (!production.Pyre.Equals(0)) {
@if (!Production.Pyre.Equals(0)) {
<div>
<b>Pyre:</b> @production.Pyre
<b>Pyre:</b> @Production.Pyre
</div>
}
@if (!production.BuildTime.Equals(0)) {
@if (!Production.BuildTime.Equals(0)) {
<div>
<b>Build Time:</b> @production.BuildTime.ToString()s
<b>Build Time:</b> @Production.BuildTime.ToString()s
</div>
}
@if (!production.Energy.Equals(0)) {
@if (!Production.Energy.Equals(0)) {
<div>
<b>Energy:</b> @production.Energy
<b>Energy:</b> @Production.Energy
</div>
}
@if (!production.Cooldown.Equals(0)) {
@if (!Production.Cooldown.Equals(0)) {
<div>
<b>Cooldown:</b> @production.Cooldown.ToString()s
<b>Cooldown:</b> @Production.Cooldown.ToString()s
</div>
}
</div>
}
@if (supply != null) {
@if (Supply != null) {
<div>
@if (!supply.Grants.Equals(0)) {
@if (!Supply.Grants.Equals(0)) {
<div>
<b>Grants:</b> @supply.Grants
<b>Grants:</b> @Supply.Grants
</div>
}
@if (!supply.Takes.Equals(0)) {
@if (!Supply.Takes.Equals(0)) {
<div>
<b>Takes:</b> @supply.Takes Supply
<b>Takes:</b> @Supply.Takes Supply
</div>
}
</div>
@@ -80,13 +74,13 @@
}
<style>
.productionContainer {
.ProductionContainer {
display: flex;
gap: 32px;
}
@@media only screen and (max-width: 1025px) {
.productionContainer {
.ProductionContainer {
flex-direction: column;
gap: 4px;
}
@@ -95,7 +89,19 @@
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
private EntityProductionModel Production => Entity.Production();
private List<EntityRequirementModel> Requirements => Entity.Requirements();
private EntitySupplyModel Supply => Entity.Supply();
protected override void OnParametersSet()
{
StateHasChanged();
}
}
@@ -37,7 +37,7 @@
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
@@ -1,40 +1,36 @@
@{
var vitality = Entity.Vitality();
var movement = Entity.Movement();
}
@if (vitality != null || movement != null) {
@if (Vitality != null || Movement != null) {
<EntityDisplayComponent Title="Stats">
<div class="statContainer">
@if (vitality != null) {
@if (Vitality != null) {
<div>
@if (!vitality.DefenseLayer.Equals(0)) {
@if (!Vitality.DefenseLayer.Equals(0)) {
<div>
<b>Shield:</b> @vitality.DefenseLayer
<b>Shield:</b> @Vitality.DefenseLayer
</div>
}
@if (!vitality.Health.Equals(0)) {
@if (!Vitality.Health.Equals(0)) {
<div>
<b>Health:</b> @vitality.Health
<b>Health:</b> @Vitality.Health
</div>
}
@if (!vitality.Energy.Equals(0)) {
@if (!Vitality.Energy.Equals(0)) {
<div>
<b>Energy:</b> @vitality.Energy
<b>Energy:</b> @Vitality.Energy
</div>
}
@if (vitality.Armor != "") {
@if (Vitality.Armor != "") {
<div>
<b>Armor:</b> @vitality.Armor
<b>Armor:</b> @Vitality.Armor
</div>
}
@if (vitality.IsEtheric) {
@if (Vitality.IsEtheric) {
<div>
<b> + Etheric</b>
</div>
}
@if (vitality.IsStructure) {
@if (Vitality.IsStructure) {
<div>
<b> + Structure</b>
</div>
@@ -43,11 +39,11 @@
}
@if (movement != null) {
@if (Movement != null) {
<div>
@if (!movement.Speed.Equals(0)) {
@if (!Movement.Speed.Equals(0)) {
<div>
<b>Speed:</b> @movement.Speed
<b>Speed:</b> @Movement.Speed
</div>
}
else {
@@ -56,7 +52,7 @@
</div>
}
<div>
<b>Move Type:</b> @movement.Movement
<b>Move Type:</b> @Movement.Movement
</div>
</div>
}
@@ -79,8 +75,9 @@
</style>
@code {
[CascadingParameter]
public EntityModel? Entity { get; set; }
[Parameter]
public EntityModel Entity { get; set; }
private EntityVitalityModel Vitality => Entity.Vitality();
private EntityMovementModel Movement => Entity.Movement();
}
@@ -32,7 +32,7 @@
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
@@ -24,8 +24,8 @@
}
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
@@ -26,7 +26,7 @@
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}
@@ -108,7 +108,7 @@
@code {
[Parameter]
public EntityModel Entity { get; set; }
[CascadingParameter]
public EntityModel? Entity { get; set; }
}