From 28087b58d97745f6c44c04fc8162f3ddd94f5796 Mon Sep 17 00:00:00 2001 From: Jonathan McCaffrey Date: Sun, 3 Apr 2022 20:09:21 -0400 Subject: [PATCH] feat(Database) Direct database/Throne links now work in the database. Added a Detailed/Plain view button --- Components/Inputs/ButtonGroupComponent.razor | 87 +++++++ IGP/Database.db | Bin 278528 -> 278528 bytes IGP/Database.db-shm | Bin 0 -> 32768 bytes IGP/Database.db-wal | Bin 0 -> 16512 bytes IGP/Dialog/EntityDialogComponent.razor | 28 +-- IGP/Pages/Database/DatabasePage.razor | 33 ++- IGP/Pages/Database/DatabaseSinglePage.razor | 78 ++++++ .../Database/Entity/EntityViewComponent.razor | 32 +-- .../Parts/EntityAbilitiesComponent.razor | 69 +++++- .../Entity/Parts/EntityHeaderComponent.razor | 44 ++-- .../Entity/Parts/EntityInfoComponent.razor | 83 +++++-- .../Parts/EntityMechanicsComponent.razor | 3 + .../Parts/EntityPassivesComponent.razor | 69 +++++- .../Parts/EntityProductionComponent.razor | 231 ++++++++++++------ .../Parts/EntityPyreSpellsComponent.razor | 60 ++++- .../Entity/Parts/EntityStatsComponent.razor | 175 +++++++++---- .../Parts/EntityUpgradesComponent.razor | 55 +++-- .../Parts/EntityVanguardAddedComponent.razor | 45 ++-- .../Parts/EntityVanguardsComponent.razor | 49 +++- .../Entity/Parts/EntityWeaponsComponent.razor | 176 +++++++++++-- .../Documentation/DocumentationPage.razor | 6 +- IGP/Program.cs | 4 + IGP/wwwroot/generated/TaskModels.json | 2 +- Model/Entity/EntityModel.cs | 15 +- Model/Model.csproj | 1 + Services/IServices.cs | 13 + Services/Immortal/EntityDisplayService.cs | 41 ++++ Services/Immortal/EntityFilterService.cs | 4 +- 28 files changed, 1115 insertions(+), 288 deletions(-) create mode 100644 Components/Inputs/ButtonGroupComponent.razor create mode 100644 IGP/Database.db-shm create mode 100644 IGP/Database.db-wal create mode 100644 IGP/Pages/Database/DatabaseSinglePage.razor create mode 100644 Services/Immortal/EntityDisplayService.cs diff --git a/Components/Inputs/ButtonGroupComponent.razor b/Components/Inputs/ButtonGroupComponent.razor new file mode 100644 index 0000000..00be2d2 --- /dev/null +++ b/Components/Inputs/ButtonGroupComponent.razor @@ -0,0 +1,87 @@ +
+
+ @foreach (var choice in Choices) { + var styleClass = ""; + if (choice.Equals(Choice)) { + styleClass = "selected"; + } + + } +
+
+ + + +@code { + + [Parameter] + public string Choice { get; set; } + + [Parameter] + public List Choices { get; set; } + + [Parameter] + public EventCallback OnClick { get; set; } + + + protected override void OnInitialized() { } + + void OnChangeChoice(string choice) + { + Choice = choice; + OnClick.InvokeAsync(choice); + } +} \ No newline at end of file diff --git a/IGP/Database.db b/IGP/Database.db index 4443386519bf3816d37785c284299d2d2dd0988e..0f749172530cb26881aefb209cdc77f33f4905c8 100644 GIT binary patch delta 244 zcmZo@5NrS<1zrvn1`&qm4E)u6yZMB9r}A>~WOLu(mgSnu#mkw?;jvla0}BTW0|SG~ zWQ`vR!c9s%{0xlsjjWC4qLR|0isq&)(*p%rN<&@qQc_bCN(&V7@=Fv-i!<}m6;dk_ zlS>pL6LWL)6r4&+O7im*GV>H%5=#=35{pw6lJoOQit=-c6BKWRQ|n*d{*0Mj-BX2uI_OeYvb7*9`U zf55ED!g!j=Z?mAlY(|zw26f))=N~fvWC0pbJ^johW-peI{FMCZ@fs|m+w~taUyK0& DnJXTa diff --git a/IGP/Database.db-shm b/IGP/Database.db-shm new file mode 100644 index 0000000000000000000000000000000000000000..d44f6d38972fa8187f0a571831704d54152f9b6d GIT binary patch literal 32768 zcmeI)tqlS}5C+iYFC-}BHG#k)K!BkEk}HK0@YDekg(pE!01gxmgN8YBxnPlS?@J~- z+1-qI1x$7sq$16zMoRs5oU^FKBR}r;tKsIlywA^ve7Zi3N88CQ`|^K`dZ(EC{789S z9i8a9QN6ON2MqxN1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5*But03O69NPX z5U80zvFTI@5FkK+009E^5NM@h3%d{?K!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ NfB*pk1PJ_-zzZF)D#-u< literal 0 HcmV?d00001 diff --git a/IGP/Database.db-wal b/IGP/Database.db-wal new file mode 100644 index 0000000000000000000000000000000000000000..5d4d78451297c3fc233c89c32ab7e36bb4e1f635 GIT binary patch literal 16512 zcmeI2Ply|J6vuzr$t0UUlb7tj+4SN_SzNj_^CwNGYe5LsZ5JC&cT;U|oz4Et4x40_ z$z*bO*ZK+nYegT>Knp$ zmS5hR_j{k;n+d-+Yd#-&fgHXuO-P#XWBZrR?ZvC#od4>=uV4O{dE#n;FYVt zzbknkOZ*GCMBr!m7Jh?I*`IhI0VIF~kN^@u0!RP}AOR$R1dsp{Kmz{)0XbB$Qc>YS zc51DcoK;$H&88#5Oz6=yt68Jnk>i=L@KES!x>B}!L+SJgGg{to?WWf?3WF#d43#af zy4D@YvUH+6rCz__j#|5N;k6sHaWD4XRvJu09k>rMOBG*JP4wBEdBt=NgM~9UbKwjdG1d zxQZgzaG0wga2**DgjkGCleYj)^!fsu*Otn~;~SUx{|jUjI)U%uO;`gH;;AdC?bOB8 zVrojdDSaqCC!Lhi$?M5?lGS8B8B1JCyq9=3vA|sLKmter2_OL^fCP{L5yTIT+JHyJZPU3)k<6I# zvgcB(@i(^qjAkcTUd;H+>7J!=bl|GKWo}#~bEe#VSy^{#U3){-j|AI4GA5G8O?io~ zwySotrc~?(KP_^Cn^s*p<#^B7Tg<-@>_49oNzs%S9JirV=$5A}(dH^;FF|Yjx@u{T zOn%IA>m8+7v+FzS!h#J+t^gvLH|0}KgPYcH zemUeK{TZj7~5hH7t_DtW4}xRwf;n?t67z5J|oumnfTg zhm~=Q6@NE_ygKB5*GK$CsI0l|hO+EgUTY@`^WZZJc&un4f2I46m9yviF@`*d*aLe{ zU*PijyHDvaef~+eFL2
- - - - - - - - - - - - - - - + + + + + + + + + + + + +
diff --git a/IGP/Pages/Database/DatabasePage.razor b/IGP/Pages/Database/DatabasePage.razor index b0625c6..4aaeaec 100644 --- a/IGP/Pages/Database/DatabasePage.razor +++ b/IGP/Pages/Database/DatabasePage.razor @@ -4,17 +4,23 @@ @implements IDisposable +@inject IEntityDisplayService entityDisplayService + Database - - - Game Patch: @EntityModel.GameVersion - - + + + Game Patch: @EntityModel.GameVersion + + - + +
+ +
+ @@ -22,7 +28,9 @@
@foreach (var entity in searches) { - + + + }
@@ -91,6 +99,13 @@ border-bottom: 4px solid var(--accent); padding: 4px; } + + .databaseInfoContainer { + display: flex; + gap: 24px; + + } + @@ -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) { diff --git a/IGP/Pages/Database/DatabaseSinglePage.razor b/IGP/Pages/Database/DatabaseSinglePage.razor new file mode 100644 index 0000000..0f0477d --- /dev/null +++ b/IGP/Pages/Database/DatabaseSinglePage.razor @@ -0,0 +1,78 @@ +@layout PageLayout + +@page "/database/{text}" + +@inject IEntityDisplayService entityDisplayService + +@implements IDisposable + + + + + + + Game Patch: @EntityModel.GameVersion + + + + +
+ +
+ + + @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 = 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); + } + +} \ No newline at end of file diff --git a/IGP/Pages/Database/Entity/EntityViewComponent.razor b/IGP/Pages/Database/Entity/EntityViewComponent.razor index 68ea6a8..1edaf8e 100644 --- a/IGP/Pages/Database/Entity/EntityViewComponent.razor +++ b/IGP/Pages/Database/Entity/EntityViewComponent.razor @@ -3,22 +3,19 @@
- - -
- - - - - - - - - - - -
-
+
+ + + + + + + + + + + +
} @@ -52,4 +49,7 @@ @code { [CascadingParameter] public EntityModel? Entity { get; set; } + + [CascadingParameter] + public string? StyleType { get; set; } } \ No newline at end of file diff --git a/IGP/Pages/Database/Entity/Parts/EntityAbilitiesComponent.razor b/IGP/Pages/Database/Entity/Parts/EntityAbilitiesComponent.razor index 788e645..4355cff 100644 --- a/IGP/Pages/Database/Entity/Parts/EntityAbilitiesComponent.razor +++ b/IGP/Pages/Database/Entity/Parts/EntityAbilitiesComponent.razor @@ -1,5 +1,6 @@ @if (Entity.IdAbilities().Count > 0) { - + @if (StyleType.Equals("Plain")) + { @foreach (var idAbility in Entity.IdAbilities()) { var spell = EntityModel.Get(idAbility.Id); @@ -8,15 +9,15 @@
- Name: + Ability Name: @spell.Info().Name
- Description: @((MarkupString)info.Description) + - Description: @((MarkupString)info.Description)
@if (!info.Notes.Trim().Equals("")) {
- Notes: @((MarkupString)info.Notes) + - Notes: @((MarkupString)info.Notes)
} @@ -24,24 +25,73 @@ @if (production != null) { if (production.Energy != 0) {
- Energy: @production.Energy + - Energy: @production.Energy
} if (production.BuildTime != 0) {
- BuildTime: @production.BuildTime + - BuildTime: @production.BuildTime
} if (production.Cooldown != 0) {
- Cooldown: @production.Cooldown + - Cooldown: @production.Cooldown
} }
} -
+ + } + else + { + + + @foreach (var idAbility in Entity.IdAbilities()) { + var spell = EntityModel.Get(idAbility.Id); + + var info = spell.Info(); + var production = spell.Production(); + +
+
+ Name: +
+
+ Description: @((MarkupString)info.Description) +
+ + @if (!info.Notes.Trim().Equals("")) { +
+ Notes: @((MarkupString)info.Notes) +
+ } + +
+ @if (production != null) { + if (production.Energy != 0) { +
+ Energy: @production.Energy +
+ } + if (production.BuildTime != 0) { +
+ BuildTime: @production.BuildTime +
+ } + if (production.Cooldown != 0) { +
+ Cooldown: @production.Cooldown +
+ } + } +
+
+ } +
+ } + } @@ -50,5 +100,8 @@ [CascadingParameter] public EntityModel? Entity { get; set; } + [CascadingParameter] + public string StyleType { get; set; } = "Detailed"; + } \ No newline at end of file diff --git a/IGP/Pages/Database/Entity/Parts/EntityHeaderComponent.razor b/IGP/Pages/Database/Entity/Parts/EntityHeaderComponent.razor index f6e8e97..f33ef3a 100644 --- a/IGP/Pages/Database/Entity/Parts/EntityHeaderComponent.razor +++ b/IGP/Pages/Database/Entity/Parts/EntityHeaderComponent.razor @@ -1,18 +1,30 @@ -
-
- @Entity.Info().Name +@if (StyleType.Equals("Plain")) +{ +
@Entity?.Info().Name + @if (Entity?.Info().Descriptive != DescriptiveType.None) + { + , @Entity?.Info().Descriptive.Replace("_", " ") + } +
+} +else +{ +
+
+ @Entity?.Info().Name +
+
+ @Entity?.EntityType.Replace("_", " ") + @if (Entity?.Info().Descriptive != DescriptiveType.None) + { + + : @Entity.Info().Descriptive.Replace("_", " ") + + } +
-
- @Entity.EntityType.Replace("_", " ") - @if (Entity.Info().Descriptive != DescriptiveType.None) { - - : @Entity.Info().Descriptive.Replace("_", " ") - - } -
-
- - +} @code { [CascadingParameter] public EntityModel? Entity { get; set; } + + [CascadingParameter] + public string StyleType { get; set; } = "Detailed"; + } \ No newline at end of file diff --git a/IGP/Pages/Database/Entity/Parts/EntityInfoComponent.razor b/IGP/Pages/Database/Entity/Parts/EntityInfoComponent.razor index 54fa49d..5835fb3 100644 --- a/IGP/Pages/Database/Entity/Parts/EntityInfoComponent.razor +++ b/IGP/Pages/Database/Entity/Parts/EntityInfoComponent.razor @@ -1,4 +1,6 @@ - + +@if (StyleType.Equals("Plain")) +{ @if (Entity.Info().Description != "") {
Description: @((MarkupString)Entity.Info().Description) @@ -6,9 +8,9 @@ } @if (Entity.Info().Notes != "") { -
- Notes: @((MarkupString)Entity.Info().Notes) -
+
+ Notes: @((MarkupString)Entity.Info().Notes) +
} @@ -40,25 +42,76 @@
}
- +} +else +{ + + @if (Entity.Info().Description != "") { +
+ Description: @((MarkupString)Entity.Info().Description) +
+ } - + + @@media only screen and (max-width: 1025px) { + .infoDisplayContainer { + flex-direction: column; + gap: 4px; + } + } + +} + + @code { [CascadingParameter] public EntityModel? Entity { get; set; } + [CascadingParameter] + public string StyleType { get; set; } = "Detailed"; + } \ No newline at end of file diff --git a/IGP/Pages/Database/Entity/Parts/EntityMechanicsComponent.razor b/IGP/Pages/Database/Entity/Parts/EntityMechanicsComponent.razor index 0810cbc..f7a68ef 100644 --- a/IGP/Pages/Database/Entity/Parts/EntityMechanicsComponent.razor +++ b/IGP/Pages/Database/Entity/Parts/EntityMechanicsComponent.razor @@ -23,5 +23,8 @@ [CascadingParameter] public EntityModel? Entity { get; set; } + + [CascadingParameter] + public string StyleType { get; set; } = "Detailed"; } \ No newline at end of file diff --git a/IGP/Pages/Database/Entity/Parts/EntityPassivesComponent.razor b/IGP/Pages/Database/Entity/Parts/EntityPassivesComponent.razor index 02ac0b9..a441760 100644 --- a/IGP/Pages/Database/Entity/Parts/EntityPassivesComponent.razor +++ b/IGP/Pages/Database/Entity/Parts/EntityPassivesComponent.razor @@ -1,5 +1,6 @@ @if (Entity.IdPassives().Count > 0) { - + @if (StyleType.Equals("Plain")) + { @foreach (var idPassive in Entity.IdPassives()) { var passive = EntityModel.Get(idPassive.Id); @@ -9,16 +10,16 @@
- Name: + Name: @info.Name
-
- Description: @((MarkupString)info.Description) +
+ - Description: @((MarkupString)info.Description)
@if (!info.Notes.Trim().Equals("")) { -
- Description: @((MarkupString)info.Notes) +
+ - Description: @((MarkupString)info.Notes)
}
@@ -27,18 +28,64 @@
@if (production.Pyre != 0) {
- Pyre: @production.Pyre + - Pyre: @production.Pyre
} @if (production.Cooldown != 0) {
- Cooldown: @production.Cooldown.ToString()s + - Cooldown: @production.Cooldown.ToString()s
}
} } - + + } + else + { + + + @foreach (var idPassive in Entity.IdPassives()) { + var passive = EntityModel.Get(idPassive.Id); + + var info = passive.Info(); + + var production = passive.Production(); + +
+
+ Name: +
+
+ Description: @((MarkupString)info.Description) +
+ + @if (!info.Notes.Trim().Equals("")) { + +
+ Description: @((MarkupString)info.Notes) +
+ } +
+ + @if (production != null) { +
+ @if (production.Pyre != 0) { +
+ Pyre: @production.Pyre +
+ } + @if (production.Cooldown != 0) { +
+ Cooldown: @production.Cooldown.ToString()s +
+ } +
+ } + } +
+ } + } @@ -47,4 +94,8 @@ [CascadingParameter] public EntityModel? Entity { get; set; } + + [CascadingParameter] + public string StyleType { get; set; } = "Detailed"; + } \ No newline at end of file diff --git a/IGP/Pages/Database/Entity/Parts/EntityProductionComponent.razor b/IGP/Pages/Database/Entity/Parts/EntityProductionComponent.razor index 0af9893..205b64c 100644 --- a/IGP/Pages/Database/Entity/Parts/EntityProductionComponent.razor +++ b/IGP/Pages/Database/Entity/Parts/EntityProductionComponent.razor @@ -1,79 +1,157 @@ -@if (@Production != null || Supply != null || Requirements.Count > 0) { - -
+@if (Production != null || Supply != null || Requirements.Count > 0) { + + @if (StyleType.Equals("Plain")) + { @if (Requirements.Count() > 0) { -
- @foreach (var requirement in Requirements) { -
- - - @requirement.Requirement.Replace("_", " "): - -
- } -
- } - - @if (Production != null && (!Production.Alloy.Equals(0) - || !Production.Ether.Equals(0) - || !Production.BuildTime.Equals(0) - || !Production.Cooldown.Equals(0))) { -
- @if (!Production.Alloy.Equals(0)) { -
- Alloy: @Production.Alloy -
- } - @if (!Production.Ether.Equals(0)) { -
- Ether: @Production.Ether -
- } - @if (!Production.Pyre.Equals(0)) { -
- Pyre: @Production.Pyre -
- } - - @if (!Production.BuildTime.Equals(0)) { -
- Build Time: @Production.BuildTime.ToString()s -
- } +
+ @foreach (var requirement in Requirements) + { + var replaced = DATA.Get()[requirement.DataType]; +
+ + + @requirement.Requirement.Replace("_", " "): @replaced.Info().Name + +
+ } +
+ } + + @if (Production != null && (!Production.Alloy.Equals(0) + || !Production.Ether.Equals(0) + || !Production.BuildTime.Equals(0) + || !Production.Cooldown.Equals(0))) { +
+ @if (!Production.Alloy.Equals(0)) { +
+ Alloy: @Production.Alloy +
+ } + @if (!Production.Ether.Equals(0)) { +
+ Ether: @Production.Ether +
+ } + @if (!Production.Pyre.Equals(0)) { +
+ Pyre: @Production.Pyre +
+ } + + @if (!Production.BuildTime.Equals(0)) { +
+ Build Time: @Production.BuildTime.ToString()s +
+ } - @if (!Production.Energy.Equals(0)) { -
- Energy: @Production.Energy -
- } - - - @if (!Production.Cooldown.Equals(0)) { -
- Cooldown: @Production.Cooldown.ToString()s -
- } -
- } - @if (Supply != null) { -
- @if (!Supply.Grants.Equals(0)) { -
- Grants: @Supply.Grants -
- } - @if (!Supply.Takes.Equals(0)) { -
- Takes: @Supply.Takes Supply -
- } -
- } -
- -} + @if (!Production.Energy.Equals(0)) { +
+ Energy: @Production.Energy +
+ } + + + @if (!Production.Cooldown.Equals(0)) { +
+ Cooldown: @Production.Cooldown.ToString()s +
+ } +
+ } + @if (Supply != null) { +
+ @if (!Supply.Grants.Equals(0)) { +
+ Grants: @Supply.Grants +
+ } + @if (!Supply.Takes.Equals(0)) { +
+ Takes: @Supply.Takes Supply +
+ } +
+ } + } + + else + { + + +
+ @if (Requirements.Count() > 0) { +
+ @foreach (var requirement in Requirements) { +
- + } +} + @code { [CascadingParameter] public EntityModel? Entity { get; set; } + + [CascadingParameter] + public string StyleType { get; set; } = "Detailed"; + private EntityProductionModel Production => Entity.Production(); private List Requirements => Entity.Requirements(); diff --git a/IGP/Pages/Database/Entity/Parts/EntityPyreSpellsComponent.razor b/IGP/Pages/Database/Entity/Parts/EntityPyreSpellsComponent.razor index 3bd3216..55fd5db 100644 --- a/IGP/Pages/Database/Entity/Parts/EntityPyreSpellsComponent.razor +++ b/IGP/Pages/Database/Entity/Parts/EntityPyreSpellsComponent.razor @@ -1,5 +1,7 @@ -@if (Entity.IdPyreSpells().Count > 0) { - +@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 @@
- Name: + Spell Name: @spell.Info().Name
- Description: @((MarkupString)info.Description) + - Description: @((MarkupString)info.Description)
@if (production != null) { if (production.Pyre != 0) { - Pyre: + - Pyre: @production.Pyre } if (production.BuildTime != 0) { - BuildTime: + - BuildTime: @production.BuildTime } if (production.Cooldown != 0) { - Cooldown: + - Cooldown: @production.Cooldown } }
} -
+ + } + else + { + + @foreach (var pyreSpell in Entity.IdPyreSpells()) { + var spell = EntityModel.Get(pyreSpell.Id); + + var info = spell.Info(); + var production = spell.Production(); + +
+
+ Name: +
+
+ Description: @((MarkupString)info.Description) +
+
+ @if (production != null) { + if (production.Pyre != 0) { + Pyre: + @production.Pyre + } + if (production.BuildTime != 0) { + BuildTime: + @production.BuildTime + } + if (production.Cooldown != 0) { + Cooldown: + @production.Cooldown + } + } +
+
+ } +
+ + } } @@ -40,4 +80,8 @@ [CascadingParameter] public EntityModel? Entity { get; set; } + + [CascadingParameter] + public string StyleType { get; set; } = "Detailed"; + } \ No newline at end of file diff --git a/IGP/Pages/Database/Entity/Parts/EntityStatsComponent.razor b/IGP/Pages/Database/Entity/Parts/EntityStatsComponent.razor index 4f17112..65c5cca 100644 --- a/IGP/Pages/Database/Entity/Parts/EntityStatsComponent.razor +++ b/IGP/Pages/Database/Entity/Parts/EntityStatsComponent.razor @@ -1,66 +1,125 @@  @if (Vitality != null || Movement != null) { - -
- @if (Vitality != null) { -
- @if (!Vitality.DefenseLayer.Equals(0)) { -
- Shield: @Vitality.DefenseLayer -
- } - @if (!Vitality.Health.Equals(0)) { -
- Health: @Vitality.Health -
- } - @if (!Vitality.Energy.Equals(0)) { -
- Energy: @Vitality.Energy -
- } - @if (Vitality.Armor != "") { -
- Armor: @Vitality.Armor -
- } + @if (StyleType.Equals("Plain")) + { + @if (Vitality != null) { +
+ @if (!Vitality.DefenseLayer.Equals(0)) { +
+ Shield: @Vitality.DefenseLayer +
+ } + @if (!Vitality.Health.Equals(0)) { +
+ Health: @Vitality.Health +
+ } + @if (!Vitality.Energy.Equals(0)) { +
+ Energy: @Vitality.Energy +
+ } + @if (Vitality.Armor != "") { +
+ Armor: @Vitality.Armor +
+ } - @if (Vitality.IsEtheric) { -
- + Etheric -
- } - @if (Vitality.IsStructure) { -
- + Structure -
- } -
- } + @if (Vitality.IsEtheric) { +
+ + Etheric +
+ } + @if (Vitality.IsStructure) { +
+ + Structure +
+ } +
+ } - @if (Movement != null) { -
- @if (!Movement.Speed.Equals(0)) { -
- Speed: @Movement.Speed -
- } - else { + @if (Movement != null) { +
+ @if (!Movement.Speed.Equals(0)) { +
+ Speed: @Movement.Speed +
+ } + else { +
+ Speed: Immobile +
+ }
- Speed: Immobile + Move Type: @Movement.Movement
- } +
+ } + } + else + { + + + +
+ @if (Vitality != null) {
- Move Type: @Movement.Movement + @if (!Vitality.DefenseLayer.Equals(0)) { +
+ Shield: @Vitality.DefenseLayer +
+ } + @if (!Vitality.Health.Equals(0)) { +
+ Health: @Vitality.Health +
+ } + @if (!Vitality.Energy.Equals(0)) { +
+ Energy: @Vitality.Energy +
+ } + @if (Vitality.Armor != "") { +
+ Armor: @Vitality.Armor +
+ } + + @if (Vitality.IsEtheric) { +
+ + Etheric +
+ } + @if (Vitality.IsStructure) { +
+ + Structure +
+ }
-
- } -
- -} + } + - + + } +} + + @code { [CascadingParameter] public EntityModel? Entity { get; set; } + + [CascadingParameter] + public string StyleType { get; set; } = "Detailed"; + + private EntityVitalityModel Vitality => Entity.Vitality(); private EntityMovementModel Movement => Entity.Movement(); } \ No newline at end of file diff --git a/IGP/Pages/Database/Entity/Parts/EntityUpgradesComponent.razor b/IGP/Pages/Database/Entity/Parts/EntityUpgradesComponent.razor index 71522f8..7199fbe 100644 --- a/IGP/Pages/Database/Entity/Parts/EntityUpgradesComponent.razor +++ b/IGP/Pages/Database/Entity/Parts/EntityUpgradesComponent.razor @@ -1,22 +1,39 @@ @if (Entity.IdUpgrades().Count > 0) { - -
- @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); +
+ Upgrade Name: @entity.Info().Name +
+
+ - Description: @entity.Info().Description +
+
+ } + + } + else + { + +
+ @foreach (var upgradeId in Entity.IdUpgrades()) { + var entity = EntityModel.Get(upgradeId.Id);
- Name: -
-
- Description: @entity.Info().Description +
+ Name: +
+
+ Description: @entity.Info().Description +
-
- } -
-
-} - - + } + +} + @code { [CascadingParameter] public EntityModel? Entity { get; set; } + + [CascadingParameter] + public string StyleType { get; set; } = "Detailed"; + } \ No newline at end of file diff --git a/IGP/Pages/Database/Entity/Parts/EntityVanguardAddedComponent.razor b/IGP/Pages/Database/Entity/Parts/EntityVanguardAddedComponent.razor index f21336d..5f02bf2 100644 --- a/IGP/Pages/Database/Entity/Parts/EntityVanguardAddedComponent.razor +++ b/IGP/Pages/Database/Entity/Parts/EntityVanguardAddedComponent.razor @@ -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]; - + @if (StyleType.Equals("Plain")) + {
+ Immortal: @immortal.Info().Name +
+ @if (!Vanguard.ReplaceId.Equals("")) {
- Immortal: + Replaces: @replaced.Info().Name
- @if (!Entity.VanguardAdded().ReplaceId.Equals("")) { + } + } + else + { + +
- Replaces: + Immortal:
- } -
-
+ @if (!Vanguard.ReplaceId.Equals("")) { +
+ Replaces: +
+ } +
+
+ } } @code { [CascadingParameter] public EntityModel? Entity { get; set; } + private EntityVanguardAddedModel? Vanguard => Entity?.VanguardAdded(); + + [CascadingParameter] + public string StyleType { get; set; } = "Detailed"; + + } \ No newline at end of file diff --git a/IGP/Pages/Database/Entity/Parts/EntityVanguardsComponent.razor b/IGP/Pages/Database/Entity/Parts/EntityVanguardsComponent.razor index 1947727..aa8747f 100644 --- a/IGP/Pages/Database/Entity/Parts/EntityVanguardsComponent.razor +++ b/IGP/Pages/Database/Entity/Parts/EntityVanguardsComponent.razor @@ -1,27 +1,60 @@ @if (Entity.IdVanguards().Count > 0) { - + @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;
- Name: + Name: @entity.Info().Name
- Replaces: + - Replaces: @replaced.Info().Name
- Built From: + - Built From: @immortal.Info().Name
} -
+ } + else + { + + @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; + +
+
+ Name: +
+
+ Replaces: +
+
+ Built From: +
+
+ } +
+ + } + } @code { @@ -29,4 +62,8 @@ [CascadingParameter] public EntityModel? Entity { get; set; } + + [CascadingParameter] + public string StyleType { get; set; } = "Detailed"; + } \ No newline at end of file diff --git a/IGP/Pages/Database/Entity/Parts/EntityWeaponsComponent.razor b/IGP/Pages/Database/Entity/Parts/EntityWeaponsComponent.razor index 1367a47..bd70d1d 100644 --- a/IGP/Pages/Database/Entity/Parts/EntityWeaponsComponent.razor +++ b/IGP/Pages/Database/Entity/Parts/EntityWeaponsComponent.razor @@ -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++; + +
+
+
+
+ Weapon @index +
+ +
+ - Damage: @data.Damage +
+ @if (data.LightDamage != 0) + { +
+ - vs Light: @data.LightDamage  +
+ } + @if (data.MediumDamage != 0) + { +
+ - vs Medium: @data.MediumDamage  +
+ } + @if (data.HeavyDamage != 0) + { +
+ - vs Heavy: @data.HeavyDamage  +
+ } + @if (data.EthericDamageBonus != 0) + { +
+ - vs Etheric +@data.EthericDamageBonus  +
+ } + @if (data.StructureDamageBonus != 0) + { +
+ - vs Structure: +@data.StructureDamageBonus  +
+ } +
+
+
+ - Range: @data.Range +
+ @if (data.SecondsBetweenAttacks > 0) + { +
+ - AttacksPerSecond: @(1 / data.SecondsBetweenAttacks) +
+
+ - (or SecondsBetweenAttacks: @data.SecondsBetweenAttacks) +
+ } + else if (data.AttacksPerSecond > 0) + { +
+ - AttacksPerSecond: @data.AttacksPerSecond +
+
+ - (or SecondsBetweenAttacks: @(1 / data.AttacksPerSecond)) +
+ } + +
+ - Targets: @data.Targets +
+ @if (data.AttacksPerSecond != 0) + { + + - DPS: @(Math.Round(data.Damage * data.AttacksPerSecond))  + + @if (data.LightDamage != 0) + { + + - Light DPS: @(Math.Round(data.LightDamage * data.AttacksPerSecond))  + + } + @if (data.MediumDamage != 0) + { + + - Medium DPS: @(Math.Round(data.MediumDamage * data.AttacksPerSecond))  + + } + @if (data.HeavyDamage != 0) + { + + - Heavy DPS: @(Math.Round(data.HeavyDamage * data.AttacksPerSecond))  + + } + } +
+ } + } + else + { +
- @foreach (var data in Entity.Weapons()) { + @foreach (var data in Entity.Weapons()) + {
Damage: @data.Damage
- @if (data.LightDamage != 0) { + @if (data.LightDamage != 0) + {
vs Light: @data.LightDamage 
} - @if (data.MediumDamage != 0) { + @if (data.MediumDamage != 0) + {
vs Medium: @data.MediumDamage 
} - @if (data.HeavyDamage != 0) { + @if (data.HeavyDamage != 0) + {
vs Heavy: @data.HeavyDamage 
} - @if (data.EthericDamageBonus != 0) { + @if (data.EthericDamageBonus != 0) + {
vs Etheric +@data.EthericDamageBonus 
} - @if (data.StructureDamageBonus != 0) { + @if (data.StructureDamageBonus != 0) + {
vs Structure: +@data.StructureDamageBonus 
@@ -38,7 +150,8 @@
Range: @data.Range
- @if (data.SecondsBetweenAttacks > 0) { + @if (data.SecondsBetweenAttacks > 0) + {
AttacksPerSecond: @(1 / data.SecondsBetweenAttacks)
@@ -46,7 +159,8 @@ (or SecondsBetweenAttacks: @data.SecondsBetweenAttacks)
} - else if (data.AttacksPerSecond > 0) { + else if (data.AttacksPerSecond > 0) + {
AttacksPerSecond: @data.AttacksPerSecond
@@ -58,33 +172,36 @@
Targets: @data.Targets
- @if (data.AttacksPerSecond != 0) { - + @if (data.AttacksPerSecond != 0) + { +
DPS: @(Math.Round(data.Damage * data.AttacksPerSecond))  - - @if (data.LightDamage != 0) { - - L: @(Math.Round(data.LightDamage * data.AttacksPerSecond))  - +
+ @if (data.LightDamage != 0) + { +
+ Light DPS: @(Math.Round(data.LightDamage * data.AttacksPerSecond))  +
} - @if (data.MediumDamage != 0) { - - M: @(Math.Round(data.MediumDamage * data.AttacksPerSecond))  - + @if (data.MediumDamage != 0) + { +
+ Medium DPS: @(Math.Round(data.MediumDamage * data.AttacksPerSecond))  +
} - @if (data.HeavyDamage != 0) { - - H: @(Math.Round(data.HeavyDamage * data.AttacksPerSecond))  - + @if (data.HeavyDamage != 0) + { +
+ Heavy DPS: @(Math.Round(data.HeavyDamage * data.AttacksPerSecond))  +
} }
}
-} - +} +} + @code { [CascadingParameter] public EntityModel? Entity { get; set; } + + [CascadingParameter] + public string StyleType { get; set; } = "Detailed"; + } \ No newline at end of file diff --git a/IGP/Pages/Documentation/DocumentationPage.razor b/IGP/Pages/Documentation/DocumentationPage.razor index 7dcb91d..fce7ce2 100644 --- a/IGP/Pages/Documentation/DocumentationPage.razor +++ b/IGP/Pages/Documentation/DocumentationPage.razor @@ -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() diff --git a/IGP/Program.cs b/IGP/Program.cs index 0e2d5dc..bcdd9f9 100644 --- a/IGP/Program.cs +++ b/IGP/Program.cs @@ -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(); builder.Services.AddSingleton(); builder.Services.AddSingleton(); +builder.Services.AddSingleton(); + + builder.Services.AddSingleton(new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); diff --git a/IGP/wwwroot/generated/TaskModels.json b/IGP/wwwroot/generated/TaskModels.json index c14d608..6599171 100644 --- a/IGP/wwwroot/generated/TaskModels.json +++ b/IGP/wwwroot/generated/TaskModels.json @@ -1 +1 @@ -[{"Id":1,"SprintModelId":null,"Name":"Support Safari","Description":"Consider other web browsers.","Notes":"Added","Status":"Todo","Priority":"Low","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":"2022-02-20T00:00:00"},{"Id":2,"SprintModelId":2,"Name":"Filter Patch Notes","Description":"You should be showing people what they really want to see in the patch notes.","Notes":"Added","Status":"Done","Priority":"Blocker","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":"2022-02-20T00:00:00"},{"Id":3,"SprintModelId":null,"Name":"Consider Pyre","Description":"Add Pyre Income. Make it so you can take Pyre Camps and Pyre Miners","Notes":"Add notes...","Status":"In_Progress","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":4,"SprintModelId":null,"Name":"Optimizations","Description":"Build Calculator should be usable.","Notes":"Add notes...","Status":"Todo","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":5,"SprintModelId":null,"Name":"Change Attack Timing Interval","Description":"Be able to sett attack timing.","Notes":"Add notes...","Status":"Todo","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":6,"SprintModelId":null,"Name":"Add Pyre Spells","Description":"Make Pyre Spells castable and consume Pyre on build order","Notes":"Add notes...","Status":"In_Progress","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":7,"SprintModelId":null,"Name":"Default builds (Rush Thrones)","Description":"Add a dropdown list of default builds.","Notes":"Add notes...","Status":"Todo","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":8,"SprintModelId":null,"Name":"Load older builds","Description":"Be able to load older builds. How are you going to handle auto correct to current patch?","Notes":"Add notes...","Status":"Todo","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":9,"SprintModelId":null,"Name":"How to use Build Calculator step by step","Description":"Need docs","Notes":"Add notes...","Status":"Todo","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":10,"SprintModelId":null,"Name":"Compare Health and Damage","Description":"Refer to community example spreadsheet.","Notes":"Add notes...","Status":"Todo","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":11,"SprintModelId":null,"Name":"Compare Unit\u0027s Damage with it\u0027s own costs","Description":"Refer to community example spreadsheet.","Notes":"Add notes...","Status":"Todo","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":12,"SprintModelId":null,"Name":"View one unit stats from a link. Make YAML copy and paste","Description":"Design so people can easily copy and paste data into discord","Notes":"Lame. Not currently supported in Blazor. I could automate up a solution, or just manually implement the url parsing, but probably best to wait","Status":"Todo","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":13,"SprintModelId":2,"Name":"Look into SQL","Description":"You really should be using SQL.","Notes":"Agile and Change log pages now use SQL","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":14,"SprintModelId":1,"Name":"Mobile Menu","Description":"You need a real mobile menu. Viewers don\u0027t scroll below the fold, so no one is going to know what happens when you click a button on phones.","Notes":"Added smaller menus for tablets and phones.","Status":"Done","Priority":"High","Task":"Feature","Project":"Management","Created":"2022-02-18T00:00:00","Finished":"2022-02-19T00:00:00"},{"Id":15,"SprintModelId":2,"Name":"Acropolis Consume Mote","Description":"The Mote is suppose to be consumed when making a Town Hall.","Notes":"Fixed","Status":"Done","Priority":"High","Task":"Bug","Project":"Management","Created":"2022-02-18T00:00:00","Finished":"2022-02-20T00:00:00"},{"Id":16,"SprintModelId":null,"Name":"Multiple Travel Time in Calculator","Description":"Travel time should be based on the amount of bases used. 3 bases is 3 travel times.","Notes":"Add notes...","Status":"Todo","Priority":"Low","Task":"Feature","Project":"Management","Created":"2022-02-18T00:00:00","Finished":null},{"Id":17,"SprintModelId":1,"Name":"Update Database to 0.0.6.8375a","Description":"Xacal tech change, and Hallower damage change. Update Godhead text.","Notes":"Done","Status":"Done","Priority":"None","Task":"Feature","Project":"Management","Created":"2022-02-18T00:00:00","Finished":"2022-02-18T00:00:00"},{"Id":18,"SprintModelId":null,"Name":"Patch History Viewer","Description":"Add an ability to compare patches, to see all nerfs and buffs made between them.","Notes":"Inspired by Zkay\u0027s post on discord, where he details a possible \u0027patch history viewer\u0027 implementation.","Status":"Fun_Idea","Priority":"None","Task":"Feature","Project":"Management","Created":"2022-02-16T00:00:00","Finished":null},{"Id":19,"SprintModelId":1,"Name":"Twitch Page","Description":"Did a ~3 hour test stream, and was personal quite happy with the quality. Make Twitch page, and stream patch, sprint planning and development on Sunday.","Notes":"Page added under General, and named \u0022Streams\u0022.","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-16T00:00:00","Finished":"2022-02-16T00:00:00"},{"Id":20,"SprintModelId":1,"Name":"Finish the database","Description":"Add more descriptions for everything. Reduce any data duplication with ids. Add upgrade connections. Add ability connections. Add passives and passives connections.","Notes":"Good enough for now","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-11T00:00:00","Finished":"2022-02-19T00:00:00"},{"Id":21,"SprintModelId":1,"Name":"Change Log View","Description":"Add a log to view last changes.","Notes":"Added changelog page. Shows Today, X Days Ago, or exact date if patch is over a week old.","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-14T00:00:00","Finished":"2022-02-14T00:00:00"},{"Id":22,"SprintModelId":1,"Name":"Agile View","Description":"Add the agile view.","Notes":"Finished.","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-11T00:00:00","Finished":"2022-02-17T00:00:00"},{"Id":23,"SprintModelId":1,"Name":"GUID for Ids","Description":"Stop using enums for ids, and start using guids. Enums are just too limited, I lose out on component and inheritance design with them. Replace all your enums with guids, rip off the bandaid.","Notes":"Add notes...","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-11T00:00:00","Finished":"2022-02-18T00:00:00"},{"Id":24,"SprintModelId":1,"Name":"Co-op overview","Description":"Write some sort of blog on co-op gameplay so you have something the feels very content-ish. Maybe make it a video.","Notes":"Finished and released early.","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-11T00:00:00","Finished":"2022-02-12T00:00:00"},{"Id":25,"SprintModelId":1,"Name":"Mobile UI","Description":"Make website work on mobile.","Notes":"Should be good. Will test on phone later.","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-15T00:00:00","Finished":"2022-02-18T00:00:00"},{"Id":26,"SprintModelId":1,"Name":"Add Making Of View","Description":"View to reference UI designs. Nicely encourages the pratice of making the UI code a lot cleaner.","Notes":"Good enough for now","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-11T00:00:00","Finished":"2022-02-19T00:00:00"},{"Id":27,"SprintModelId":3,"Name":"Close Nav Menu on Navigation","Description":"Close Nav Menu on Navigation","Notes":null,"Status":"Done","Priority":"High","Task":"Bug","Project":"Management","Created":"2022-03-27T00:00:00","Finished":"2022-03-27T00:00:00"},{"Id":28,"SprintModelId":3,"Name":"Add Passive Descriptions and Passive","Description":"Have to guess on a bunch of passives","Notes":null,"Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-03-27T00:00:00","Finished":"2022-03-31T00:00:00"},{"Id":29,"SprintModelId":3,"Name":"Tooltips that show referenced units","Description":"I should see any referenced unit by hovering over it","Notes":"Links can now go to links which can go to links.","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-03-27T00:00:00","Finished":"2022-04-01T00:00:00"},{"Id":30,"SprintModelId":null,"Name":"Update Logo for Website","Description":"After color scheme is picked","Notes":null,"Status":"Todo","Priority":"Low","Task":"Feature","Project":"Management","Created":"2022-03-27T00:00:00","Finished":null},{"Id":31,"SprintModelId":3,"Name":"Documentation page","Description":"Add documents on how to maintain website","Notes":"Added start of documents","Status":"Done","Priority":"Low","Task":"Feature","Project":"Management","Created":"2022-03-27T00:00:00","Finished":"2022-04-03T00:00:00"},{"Id":32,"SprintModelId":null,"Name":"Test Automation","Description":"Selenium Tests","Notes":"Start adding IDs to everything","Status":"Todo","Priority":"Low","Task":"Feature","Project":"Management","Created":"2022-03-27T00:00:00","Finished":null},{"Id":33,"SprintModelId":null,"Name":"Unit Test","Description":"Add some unit tests","Notes":null,"Status":"Todo","Priority":"Low","Task":"Feature","Project":"Management","Created":"2022-03-27T00:00:00","Finished":null},{"Id":34,"SprintModelId":null,"Name":"Fully Transfer everything to SQL","Description":"Need to regenerate the database once everthing is fully transfered","Notes":null,"Status":"Todo","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-03-27T00:00:00","Finished":null},{"Id":35,"SprintModelId":3,"Name":"Adding a loading Component","Description":"For JSON loading","Notes":"Added loading component to Agile and Changelog screens","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-03-27T00:00:00","Finished":"2022-03-27T00:00:00"},{"Id":36,"SprintModelId":3,"Name":"Optimize Loading of Data","Description":"Currently loading non Agile stuff on Agile page","Notes":"Moved SQL database injection to app root","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-03-27T00:00:00","Finished":"2022-03-27T00:00:00"},{"Id":37,"SprintModelId":3,"Name":"Convert Notes to Markdown","Description":"Using Markdown and generating the Note pages seems like a better solution to SQL or hardcoding data","Notes":null,"Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-03-27T00:00:00","Finished":"2022-04-01T00:00:00"},{"Id":38,"SprintModelId":3,"Name":"Improve Entity Filter Options","Description":"The options I give you is strange, given it filers on Faction type","Notes":null,"Status":"Done","Priority":"High","Task":"Bug","Project":"Management","Created":"2022-04-01T00:00:00","Finished":"2022-04-03T00:00:00"},{"Id":39,"SprintModelId":4,"Name":"Refresh Database Bug","Description":"Database dialog UI isn\u0027t refreshing enough","Notes":null,"Status":"In_Progress","Priority":"High","Task":"Bug","Project":"Management","Created":"2022-04-03T00:00:00","Finished":null},{"Id":40,"SprintModelId":4,"Name":"Branding Stuff","Description":"Add a schedule, improving branding, etc, ","Notes":null,"Status":"Todo","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-04-03T00:00:00","Finished":null}] \ No newline at end of file +[{"Id":1,"SprintModelId":null,"Name":"Support Safari","Description":"Consider other web browsers.","Notes":"Added","Status":"Todo","Priority":"Low","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":"2022-02-20T00:00:00"},{"Id":2,"SprintModelId":2,"Name":"Filter Patch Notes","Description":"You should be showing people what they really want to see in the patch notes.","Notes":"Added","Status":"Done","Priority":"Blocker","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":"2022-02-20T00:00:00"},{"Id":3,"SprintModelId":null,"Name":"Consider Pyre","Description":"Add Pyre Income. Make it so you can take Pyre Camps and Pyre Miners","Notes":"Add notes...","Status":"In_Progress","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":4,"SprintModelId":null,"Name":"Optimizations","Description":"Build Calculator should be usable.","Notes":"Add notes...","Status":"Todo","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":5,"SprintModelId":null,"Name":"Change Attack Timing Interval","Description":"Be able to sett attack timing.","Notes":"Add notes...","Status":"Todo","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":6,"SprintModelId":null,"Name":"Add Pyre Spells","Description":"Make Pyre Spells castable and consume Pyre on build order","Notes":"Add notes...","Status":"In_Progress","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":7,"SprintModelId":null,"Name":"Default builds (Rush Thrones)","Description":"Add a dropdown list of default builds.","Notes":"Add notes...","Status":"Todo","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":8,"SprintModelId":null,"Name":"Load older builds","Description":"Be able to load older builds. How are you going to handle auto correct to current patch?","Notes":"Add notes...","Status":"Todo","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":9,"SprintModelId":null,"Name":"How to use Build Calculator step by step","Description":"Need docs","Notes":"Add notes...","Status":"Todo","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":10,"SprintModelId":null,"Name":"Compare Health and Damage","Description":"Refer to community example spreadsheet.","Notes":"Add notes...","Status":"Todo","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":11,"SprintModelId":null,"Name":"Compare Unit\u0027s Damage with it\u0027s own costs","Description":"Refer to community example spreadsheet.","Notes":"Add notes...","Status":"Todo","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":12,"SprintModelId":4,"Name":"View one unit stats from a link. Make YAML copy and paste","Description":"Design so people can easily copy and paste data into discord","Notes":"Ended up not using exact Yaml. Button in Database controls Detailed vs Plain display ","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":"2022-04-03T00:00:00"},{"Id":13,"SprintModelId":2,"Name":"Look into SQL","Description":"You really should be using SQL.","Notes":"Agile and Change log pages now use SQL","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-20T00:00:00","Finished":null},{"Id":14,"SprintModelId":1,"Name":"Mobile Menu","Description":"You need a real mobile menu. Viewers don\u0027t scroll below the fold, so no one is going to know what happens when you click a button on phones.","Notes":"Added smaller menus for tablets and phones.","Status":"Done","Priority":"High","Task":"Feature","Project":"Management","Created":"2022-02-18T00:00:00","Finished":"2022-02-19T00:00:00"},{"Id":15,"SprintModelId":2,"Name":"Acropolis Consume Mote","Description":"The Mote is suppose to be consumed when making a Town Hall.","Notes":"Fixed","Status":"Done","Priority":"High","Task":"Bug","Project":"Management","Created":"2022-02-18T00:00:00","Finished":"2022-02-20T00:00:00"},{"Id":16,"SprintModelId":null,"Name":"Multiple Travel Time in Calculator","Description":"Travel time should be based on the amount of bases used. 3 bases is 3 travel times.","Notes":"Add notes...","Status":"Todo","Priority":"Low","Task":"Feature","Project":"Management","Created":"2022-02-18T00:00:00","Finished":null},{"Id":17,"SprintModelId":1,"Name":"Update Database to 0.0.6.8375a","Description":"Xacal tech change, and Hallower damage change. Update Godhead text.","Notes":"Done","Status":"Done","Priority":"None","Task":"Feature","Project":"Management","Created":"2022-02-18T00:00:00","Finished":"2022-02-18T00:00:00"},{"Id":18,"SprintModelId":null,"Name":"Patch History Viewer","Description":"Add an ability to compare patches, to see all nerfs and buffs made between them.","Notes":"Inspired by Zkay\u0027s post on discord, where he details a possible \u0027patch history viewer\u0027 implementation.","Status":"Fun_Idea","Priority":"None","Task":"Feature","Project":"Management","Created":"2022-02-16T00:00:00","Finished":null},{"Id":19,"SprintModelId":1,"Name":"Twitch Page","Description":"Did a ~3 hour test stream, and was personal quite happy with the quality. Make Twitch page, and stream patch, sprint planning and development on Sunday.","Notes":"Page added under General, and named \u0022Streams\u0022.","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-16T00:00:00","Finished":"2022-02-16T00:00:00"},{"Id":20,"SprintModelId":1,"Name":"Finish the database","Description":"Add more descriptions for everything. Reduce any data duplication with ids. Add upgrade connections. Add ability connections. Add passives and passives connections.","Notes":"Good enough for now","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-11T00:00:00","Finished":"2022-02-19T00:00:00"},{"Id":21,"SprintModelId":1,"Name":"Change Log View","Description":"Add a log to view last changes.","Notes":"Added changelog page. Shows Today, X Days Ago, or exact date if patch is over a week old.","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-14T00:00:00","Finished":"2022-02-14T00:00:00"},{"Id":22,"SprintModelId":1,"Name":"Agile View","Description":"Add the agile view.","Notes":"Finished.","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-11T00:00:00","Finished":"2022-02-17T00:00:00"},{"Id":23,"SprintModelId":1,"Name":"GUID for Ids","Description":"Stop using enums for ids, and start using guids. Enums are just too limited, I lose out on component and inheritance design with them. Replace all your enums with guids, rip off the bandaid.","Notes":"Add notes...","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-11T00:00:00","Finished":"2022-02-18T00:00:00"},{"Id":24,"SprintModelId":1,"Name":"Co-op overview","Description":"Write some sort of blog on co-op gameplay so you have something the feels very content-ish. Maybe make it a video.","Notes":"Finished and released early.","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-11T00:00:00","Finished":"2022-02-12T00:00:00"},{"Id":25,"SprintModelId":1,"Name":"Mobile UI","Description":"Make website work on mobile.","Notes":"Should be good. Will test on phone later.","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-15T00:00:00","Finished":"2022-02-18T00:00:00"},{"Id":26,"SprintModelId":1,"Name":"Add Making Of View","Description":"View to reference UI designs. Nicely encourages the pratice of making the UI code a lot cleaner.","Notes":"Good enough for now","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-02-11T00:00:00","Finished":"2022-02-19T00:00:00"},{"Id":27,"SprintModelId":3,"Name":"Close Nav Menu on Navigation","Description":"Close Nav Menu on Navigation","Notes":null,"Status":"Done","Priority":"High","Task":"Bug","Project":"Management","Created":"2022-03-27T00:00:00","Finished":"2022-03-27T00:00:00"},{"Id":28,"SprintModelId":3,"Name":"Add Passive Descriptions and Passive","Description":"Have to guess on a bunch of passives","Notes":null,"Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-03-27T00:00:00","Finished":"2022-03-31T00:00:00"},{"Id":29,"SprintModelId":3,"Name":"Tooltips that show referenced units","Description":"I should see any referenced unit by hovering over it","Notes":"Links can now go to links which can go to links.","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-03-27T00:00:00","Finished":"2022-04-01T00:00:00"},{"Id":30,"SprintModelId":null,"Name":"Update Logo for Website","Description":"After color scheme is picked","Notes":null,"Status":"Todo","Priority":"Low","Task":"Feature","Project":"Management","Created":"2022-03-27T00:00:00","Finished":null},{"Id":31,"SprintModelId":3,"Name":"Documentation page","Description":"Add documents on how to maintain website","Notes":"Added start of documents","Status":"Done","Priority":"Low","Task":"Feature","Project":"Management","Created":"2022-03-27T00:00:00","Finished":"2022-04-03T00:00:00"},{"Id":32,"SprintModelId":null,"Name":"Test Automation","Description":"Selenium Tests","Notes":"Start adding IDs to everything","Status":"Todo","Priority":"Low","Task":"Feature","Project":"Management","Created":"2022-03-27T00:00:00","Finished":null},{"Id":33,"SprintModelId":null,"Name":"Unit Test","Description":"Add some unit tests","Notes":null,"Status":"Todo","Priority":"Low","Task":"Feature","Project":"Management","Created":"2022-03-27T00:00:00","Finished":null},{"Id":34,"SprintModelId":null,"Name":"Fully Transfer everything to SQL","Description":"Need to regenerate the database once everthing is fully transfered","Notes":null,"Status":"Todo","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-03-27T00:00:00","Finished":null},{"Id":35,"SprintModelId":3,"Name":"Adding a loading Component","Description":"For JSON loading","Notes":"Added loading component to Agile and Changelog screens","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-03-27T00:00:00","Finished":"2022-03-27T00:00:00"},{"Id":36,"SprintModelId":3,"Name":"Optimize Loading of Data","Description":"Currently loading non Agile stuff on Agile page","Notes":"Moved SQL database injection to app root","Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-03-27T00:00:00","Finished":"2022-03-27T00:00:00"},{"Id":37,"SprintModelId":3,"Name":"Convert Notes to Markdown","Description":"Using Markdown and generating the Note pages seems like a better solution to SQL or hardcoding data","Notes":null,"Status":"Done","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-03-27T00:00:00","Finished":"2022-04-01T00:00:00"},{"Id":38,"SprintModelId":3,"Name":"Improve Entity Filter Options","Description":"The options I give you is strange, given it filers on Faction type","Notes":null,"Status":"Done","Priority":"High","Task":"Bug","Project":"Management","Created":"2022-04-01T00:00:00","Finished":"2022-04-03T00:00:00"},{"Id":39,"SprintModelId":4,"Name":"Refresh Database Bug","Description":"Database dialog UI isn\u0027t refreshing enough","Notes":null,"Status":"Done","Priority":"High","Task":"Bug","Project":"Management","Created":"2022-04-03T00:00:00","Finished":null},{"Id":40,"SprintModelId":4,"Name":"Branding Stuff","Description":"Add a schedule, improving branding, etc, ","Notes":null,"Status":"Todo","Priority":"Medium","Task":"Feature","Project":"Management","Created":"2022-04-03T00:00:00","Finished":null}] \ No newline at end of file diff --git a/Model/Entity/EntityModel.cs b/Model/Entity/EntityModel.cs index 683d9fc..800b4a7 100644 --- a/Model/Entity/EntityModel.cs +++ b/Model/Entity/EntityModel.cs @@ -1,10 +1,10 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; +using System.Collections.Generic; using System.Linq; +using System.Text; using Model.Immortal.Entity.Data; using Model.Immortal.Entity.Parts; using Model.Immortal.Types; +using YamlDotNet.Serialization; namespace Model.Immortal.Entity; @@ -28,6 +28,13 @@ public class EntityModel { IsSpeculative = isSpeculative; } + public string AsYaml() { + var stringBuilder = new StringBuilder(); + var serializer = new Serializer(); + stringBuilder.AppendLine(serializer.Serialize(this)); + return stringBuilder.ToString(); + } + public string DataType { get; set; } // TODO Serilization currently being used for build orders @@ -71,6 +78,8 @@ public class EntityModel { } + + public static List GetList() { if (entityModels == null) entityModels = DATA.Get().Values.ToList(); diff --git a/Model/Model.csproj b/Model/Model.csproj index f5bd194..e033279 100644 --- a/Model/Model.csproj +++ b/Model/Model.csproj @@ -13,5 +13,6 @@ + diff --git a/Services/IServices.cs b/Services/IServices.cs index 9e7903c..51da9ad 100644 --- a/Services/IServices.cs +++ b/Services/IServices.cs @@ -190,10 +190,23 @@ public interface IEntityFilterService { public void Unsubscribe(EntityFilterAction action); } + public interface IEntityService { public List GetEntities(); } + + +public interface IEntityDisplayService +{ + public List DefaultChoices(); + + public string GetDisplayType(); + public void SetDisplayType(string displayType); + public void Subscribe(Action action); + public void Unsubscribe(Action action); +} + public interface IImmortalSelectionService { public string GetFactionType(); public string GetImmortalType(); diff --git a/Services/Immortal/EntityDisplayService.cs b/Services/Immortal/EntityDisplayService.cs new file mode 100644 index 0000000..1a86e33 --- /dev/null +++ b/Services/Immortal/EntityDisplayService.cs @@ -0,0 +1,41 @@ +using Model.Immortal.Types; + +namespace Services.Immortal; + +public class EntityDisplayService : IEntityDisplayService { + private string displayType = "Detailed"; + private event Action _onChange; + + public List DefaultChoices() + { + return new List() { "Detailed", "Plain" }; + } + + public void Subscribe(Action action) { + _onChange += action; + } + + public void Unsubscribe(Action action) { + _onChange -= action; + } + + private void NotifyDataChanged() { + _onChange?.Invoke(); + } + + public Action OnChange() { + return _onChange; + } + + public string GetDisplayType() + { + return displayType; + } + + public void SetDisplayType(string displayType) + { + this.displayType = displayType; + NotifyDataChanged(); + } + +} \ No newline at end of file diff --git a/Services/Immortal/EntityFilterService.cs b/Services/Immortal/EntityFilterService.cs index abb237b..702f965 100644 --- a/Services/Immortal/EntityFilterService.cs +++ b/Services/Immortal/EntityFilterService.cs @@ -21,7 +21,7 @@ public class EntityFilterService : IEntityFilterService { private string _selectedFaction = FactionType.Any; private string _selectedImmortal = ImmortalType.Any; - + public EntityFilterService() { RefreshImmortalChoices(); RefreshEntityChoices(); @@ -46,7 +46,7 @@ public class EntityFilterService : IEntityFilterService { public string GetImmortalType() { return _selectedImmortal; } - + public bool SelectFactionType(string factionType) { if (_selectedFaction == factionType) {