Browse Source

open source update. Fixed Database filters, added docs page

main
Jonathan McCaffrey 4 years ago
parent
commit
73cc82709c
  1. BIN
      IGP/Database.db
  2. 6
      IGP/IGP.csproj
  3. 141
      IGP/Pages/Documentation/DocumentationPage.razor
  4. 2
      IGP/Pages/Notes/NotesPage.razor
  5. 3
      IGP/Program.cs
  6. 1
      IGP/wwwroot/css/app.css
  7. 2
      IGP/wwwroot/generated/DocumentationModels.json
  8. 2
      IGP/wwwroot/generated/WebPageModels.json
  9. 23
      Model/Entity/Data/DATA.cs
  10. 7
      Model/Entity/Data/EntityType.cs
  11. 12
      Services/Development/AgileService.cs
  12. 71
      Services/Development/DocumentationService.cs
  13. 10
      Services/Development/GitService.cs
  14. 9
      Services/Development/NoteService.cs
  15. 11
      Services/IServices.cs
  16. 8
      Services/Immortal/EntityFilterService.cs
  17. 2
      Services/Website/WebsiteService.cs

BIN
IGP/Database.db

Binary file not shown.

6
IGP/IGP.csproj

@ -16,6 +16,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Markdig" Version="0.28.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0-preview.2.22153.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0-preview.2.22153.2" PrivateAssets="all" />
<!--
@ -35,9 +36,4 @@
<ProjectReference Include="..\Model\Model.csproj" />
<ProjectReference Include="..\Services\Services.csproj" />
</ItemGroup>
<ItemGroup>
<_ContentIncludedByDefault Remove="Pages\Notes\Pages\CoopHoldout.razor" />
</ItemGroup>
</Project>

141
IGP/Pages/Documentation/DocumentationPage.razor

@ -0,0 +1,141 @@
@layout PageLayout
@inject IDocumentationService DocumentationService
@using Markdig
@implements IDisposable
@page "/docs"
@if (!DocumentationService.IsLoaded())
{
<LoadingComponent></LoadingComponent>
}
else
{
<LayoutMediumContentComponent>
<WebsiteTitleComponent>Documentation</WebsiteTitleComponent>
<div class="section">
<div for="docSection">Section: </div>
<div style="flex: 1"></div>
<select @oninput="OnSectionChanged" style="background-color: #36393F; width: 250px; margin-right: 16px;" name="docSection">
<option value="All">All</option>
</select>
</div>
<div class="docsContainer">
@foreach (var doc in DocumentationService.DocumentationModels) {
if (selectedSection != "All" && doc.Section != selectedSection) {
continue;
}
<PaperComponent>
<div style="display: flex; flex-direction: row;">
<span style="font-weight: bold; font-style:italic;">@doc.Section</span>
<div style="flex: 1"></div>
<span style="font-weight: bold; font-style:italic;">Last Updated on @doc.UpdatedDate.ToString("MM/dd/yyyy")</span>
</div>
<div>
<div id="@doc.Id" style="font-weight: bold; font-size: 1.4rem;">@doc.Name</div>
<div>@((MarkupString)Markdown.ToHtml(doc.Description))</div>
</div>
</PaperComponent>
}
</div>
</LayoutMediumContentComponent>
}
<style>
.section {
display: flex;
width: 500px;
flex-direction: row;
background-color: var(--paper);
justify-content: center;
padding: 24px;
border: 4px solid var(--paper-border);
box-shadow: 0px 6px var(--paper-border);
}
.docsContainer {
display: flex;
flex-direction: column;
gap: 16px;
}
pre code {
color: white;
}
h1 {
display: block;
font-size: 2em;
margin-top: 0.67em;
margin-bottom: 0.67em;
margin-left: 0;
margin-right: 0;
font-weight: bold;
}
h2 {
display: block;
font-size: 1.5em;
margin-top: 0.83em;
margin-bottom: 0.83em;
margin-left: 0;
margin-right: 0;
font-weight: bold;
}
li {
display: list-item;
}
p {
display: block;
margin-top: 1em;
margin-bottom: 1em;
margin-left: 0;
margin-right: 0;
}
ul {
display: block;
list-style-type: disc;
margin-top: 1em;
margin-bottom: 1em;
margin-left: 0;
margin-right: 0;
padding-left: 40px;
}
pre {
background: black;
padding: 2px;
}
</style>
@code {
string selectedSection = "All";
protected override void OnInitialized()
{
DocumentationService.Subscribe(StateHasChanged);
DocumentationService.Load();
}
public void Dispose()
{
DocumentationService.Unsubscribe(StateHasChanged);
}
void OnSectionChanged(ChangeEventArgs e) {
selectedSection = e.Value.ToString();
StateHasChanged();
}
}

2
IGP/Pages/Notes/NotesPage.razor

@ -60,8 +60,6 @@ else
display: flex;
width: 500px;
flex-direction: row;
padding: 4px;
border: 2px solid black;
background-color: var(--paper);
justify-content: center;
padding: 24px;

3
IGP/Program.cs

@ -12,7 +12,7 @@ using Microsoft.EntityFrameworkCore;
using Services;
using Services.Immortal;
using Services.Website;
using Services.Work;
using Services.Development;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.Logging.SetMinimumLevel(LogLevel.Warning);
@ -50,6 +50,7 @@ builder.Services.AddSingleton<IWebsiteService, WebsiteService>();
builder.Services.AddSingleton<IAgileService, AgileService>();
builder.Services.AddSingleton<IGitService, GitService>();
builder.Services.AddSingleton<INoteService, NoteService>();
builder.Services.AddSingleton<IDocumentationService, DocumentationService>();
await builder.Build().RunAsync();

1
IGP/wwwroot/css/app.css

@ -23,6 +23,7 @@
--dialog-radius: 6px;
}
html {
box-sizing: border-box;
}

2
IGP/wwwroot/generated/DocumentationModels.json

@ -1 +1 @@
[{"Id":1,"CreatedDate":"2022-03-30T00:00:00","UpdatedDate":"2022-03-30T00:00:00","Name":"Setup","Section":"Getting Started","Description":"# Setup\n\nThis document will contain general setup notes for the project.\n\n## Prerequisite\n\nTo understand content in this document, it is recommended to have some software development experience. Particularly using GitHub and Visual Studio.\n\n- [GitHub Documentation](https://docs.github.com/en/get-started)\n\n- [Visual Studio Documentation](https://visualstudio.microsoft.com/vs/getting-started/)\n\nTo make updates to this website, it is recommended to understand HTML/CSS and C#.\n\n- [C# Documentation](https://docs.microsoft.com/en-us/dotnet/csharp/)\n- [Mozilla\u0027s HTML Documentation](https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Getting_started)\n- [W3SCHOOLS\u0027 HTML Documentation](https://www.w3schools.com/html/)\n\nFurther, you should understand the product and clients this website is for. So it is recommended to play \u0022Immortal: Gates of Pyre\u0022.\n- [IGP Website](https://gatesofpyre.com/) \n - **Please Note:** This product currently has restricted access with it is in a pre-alpha state. If you are not aware or interested in IGP, I recommend to wait for product release. Otherwise, check out their discord for steps of getting access.\n\n\n## Installation\n\nDownload and install Visual Studio preview.\n\nhttps://visualstudio.microsoft.com/vs/preview/\n\nWhen installing, ensure you have selected \u0022Workloads | **ASP.NET and web development**\u0022 and \u0022Individual components | **.NET WebAssembly build tools**\u0022.\n\n## Download Project\n\nGet this project from GitHub. \n\n\u0060\u0060\u0060bash\ngit clone https://github.com/JonathanMcCaffrey/IGP-Fan-Reference.git\n\u0060\u0060\u0060\n\n## Project Tree\n\u0060\u0060\u0060\nC:.\n\u251C\u2500\u2500\u2500.github\n\u2502 \u2514\u2500\u2500\u2500workflows # Workflows to deploy website\n\u251C\u2500\u2500\u2500Components # Components used be website\n\u251C\u2500\u2500\u2500Contexts\n\u251C\u2500\u2500\u2500IGP\n\u2502 \u251C\u2500\u2500\u2500Pages # Website pages\n\u2502 \u2514\u2500\u2500\u2500wwwroot \n\u2502 \u251C\u2500\u2500\u2500css\n\u2502 \u251C\u2500\u2500\u2500generated # Files generated by IGP_Convert. Do not edit\n\u2502 \u251C\u2500\u2500\u2500image\n\u2502 \u251C\u2500\u2500\u2500javascript\n\u2502 \u2514\u2500\u2500\u2500markdown\n\u2502 \u2514\u2500\u2500\u2500documentation # Documentation files\n\u251C\u2500\u2500\u2500IGP_Convert # Converts SQL into JSON for Blazor Wasm\n\u251C\u2500\u2500\u2500Model # Data models\n\u2514\u2500\u2500\u2500Services # Web services\n\u0060\u0060\u0060\n\n## Running\n\n- Open \u0060IGP/IGP.sln\u0060. \n- Click the green RUN button in Visual Studio.\n- A local copy of the IGP Website should have launched on your machine.\n\n\n## Publishing\n\n**Important:** publishing new version of the website will not occur until issue [39528](https://github.com/dotnet/aspnetcore/issues/39528) in dotnet/aspnetcore is resolved.\n\n\nCode committed to the \u0060main\u0060 branch will automatically be deployed to [production](https://www.igpfanreference.com/).\n\nCode committed to the \u0060develop\u0060 branch will automatically be deployed to [development](https://calm-mud-04916b210.1.azurestaticapps.net/).\n\n*This is handle via the files in \u0060.github/workflow\u0060. Look into these [GitHub Actions Documents](https://docs.github.com/en/actions) if curious about how this CI system works.*\n\n\n## Troubleshooting\n\nNothing that some good internet searches cannot resolved. But you can also contact the project maintainer on [IGP Fan Reference](https://discord.gg/uMq8bMGeeN) Discord.\n\n"}]
[{"Id":1,"CreatedDate":"2022-03-30T00:00:00","UpdatedDate":"2022-03-30T00:00:00","Name":"Setup","Section":"Getting Started","Description":"# Setup\n\nThis document will contain general setup notes for the project.\n\n## Prerequisite\n\nTo understand content in this document, it is recommended to have some software development experience. Particularly using GitHub and Visual Studio.\n\n- [GitHub Documentation](https://docs.github.com/en/get-started)\n\n- [Visual Studio Documentation](https://visualstudio.microsoft.com/vs/getting-started/)\n\nTo make updates to this website, it is recommended to understand HTML/CSS and C#.\n\n- [C# Documentation](https://docs.microsoft.com/en-us/dotnet/csharp/)\n- [Mozilla\u0027s HTML Documentation](https://developer.mozilla.org/en-US/docs/Learn/HTML/Introduction_to_HTML/Getting_started)\n- [W3SCHOOLS\u0027 HTML Documentation](https://www.w3schools.com/html/)\n\nFurther, you should understand the product and clients this website is for. So it is recommended to play \u0022Immortal: Gates of Pyre\u0022.\n- [IGP Website](https://gatesofpyre.com/) \n - **Please Note:** This product currently has restricted access with it is in a pre-alpha state. If you are not aware or interested in IGP, I recommend to wait for product release. Otherwise, check out their discord for steps of getting access.\n\n\n## Installation\n\nDownload and install Visual Studio preview.\n\nhttps://visualstudio.microsoft.com/vs/preview/\n\nWhen installing, ensure you have selected \u0022Workloads | **ASP.NET and web development**\u0022 and \u0022Individual components | **.NET WebAssembly build tools**\u0022.\n\n## Download Project\n\nGet this project from GitHub. \n\n\u0060\u0060\u0060bash\ngit clone https://github.com/JonathanMcCaffrey/IGP-Fan-Reference.git\n\u0060\u0060\u0060\n\n## Project Tree\n\u0060\u0060\u0060\nC:.\n\u251C\u2500\u2500\u2500.github\n\u2502 \u2514\u2500\u2500\u2500workflows # Workflows to deploy website\n\u251C\u2500\u2500\u2500Components # Components used be website\n\u251C\u2500\u2500\u2500Contexts\n\u251C\u2500\u2500\u2500IGP\n\u2502 \u251C\u2500\u2500\u2500Pages # Website pages\n\u2502 \u2514\u2500\u2500\u2500wwwroot \n\u2502 \u251C\u2500\u2500\u2500css\n\u2502 \u251C\u2500\u2500\u2500generated # Files generated by IGP_Convert. Do not edit\n\u2502 \u251C\u2500\u2500\u2500image\n\u2502 \u251C\u2500\u2500\u2500javascript\n\u2502 \u2514\u2500\u2500\u2500markdown\n\u2502 \u2514\u2500\u2500\u2500documentation # Documentation files\n\u251C\u2500\u2500\u2500IGP_Convert # Converts SQL into JSON for Blazor Wasm\n\u251C\u2500\u2500\u2500Model # Data models\n\u2514\u2500\u2500\u2500Services # Web services\n\u0060\u0060\u0060\n\n## Running\n\n- Open \u0060IGP/IGP.sln\u0060. \n- Click the green RUN button in Visual Studio.\n- A local copy of the IGP Website should have launched on your machine.\n\n\n## Publishing\n\nCode committed to the \u0060main\u0060 branch will automatically be deployed to [production](https://www.igpfanreference.com/).\n\nCode committed to the \u0060develop\u0060 branch will automatically be deployed to [development](https://calm-mud-04916b210.1.azurestaticapps.net/).\n\n*This is handle via the files in \u0060.github/workflow\u0060. Look into these [GitHub Actions Documents](https://docs.github.com/en/actions) if curious about how this CI system works.*\n\n\n## Troubleshooting\n\nNothing that some good internet searches cannot resolved. But you can also contact the project maintainer on [IGP Fan Reference](https://discord.gg/uMq8bMGeeN) Discord.\n\n"}]

2
IGP/wwwroot/generated/WebPageModels.json

@ -1 +1 @@
[{"Id":1,"WebSectionModelId":2,"Name":"Database","Description":"Database of game information","Href":"database","IsPrivate":"False"},{"Id":2,"WebSectionModelId":1,"Name":"Build Calculator","Description":"Build order calculator for determining army timings","Href":"build-calculator","IsPrivate":"False"},{"Id":3,"WebSectionModelId":1,"Name":"Harass Calculator","Description":"Alloy harassment calculator","Href":"harass-calculator","IsPrivate":"False"},{"Id":4,"WebSectionModelId":1,"Name":"Memory Tester","Description":"Testing memory","Href":"memory-tester","IsPrivate":"False"},{"Id":5,"WebSectionModelId":1,"Name":"Comparion Charts","Description":"Ecnomy charts to compare build orders","Href":"comparison-charts","IsPrivate":"True"},{"Id":6,"WebSectionModelId":2,"Name":"Notes","Description":"General player notes","Href":"notes","IsPrivate":"False"},{"Id":7,"WebSectionModelId":2,"Name":"Key Mapping","Description":"General key mapping info","Href":"keymapping","IsPrivate":"True"},{"Id":8,"WebSectionModelId":4,"Name":"Road Map","Description":"Plans for this website","Href":"roadmap","IsPrivate":"False"},{"Id":9,"WebSectionModelId":4,"Name":"Change Log","Description":"Past updates to the website","Href":"changelog","IsPrivate":"False"},{"Id":10,"WebSectionModelId":4,"Name":"Agile","Description":"Showing agile view of this website","Href":"agile","IsPrivate":"False"},{"Id":11,"WebSectionModelId":4,"Name":"Making Of","Description":"Explaining development details of this website","Href":"makingof","IsPrivate":"False"},{"Id":12,"WebSectionModelId":2,"Name":"Documentation","Description":"Explaining how to use this website","Href":"documentation","IsPrivate":"True"},{"Id":13,"WebSectionModelId":3,"Name":"About","Description":"Answering general questions on the website","Href":"about","IsPrivate":"False"},{"Id":14,"WebSectionModelId":3,"Name":"Contact","Description":"My contact info","Href":"contact","IsPrivate":"False"},{"Id":15,"WebSectionModelId":3,"Name":"Streams","Description":"Stream info","Href":"streams","IsPrivate":"False"}]
[{"Id":1,"WebSectionModelId":2,"Name":"Database","Description":"Database of game information","Href":"database","IsPrivate":"False"},{"Id":2,"WebSectionModelId":1,"Name":"Build Calculator","Description":"Build order calculator for determining army timings","Href":"build-calculator","IsPrivate":"False"},{"Id":3,"WebSectionModelId":1,"Name":"Harass Calculator","Description":"Alloy harassment calculator","Href":"harass-calculator","IsPrivate":"False"},{"Id":4,"WebSectionModelId":1,"Name":"Memory Tester","Description":"Testing memory","Href":"memory-tester","IsPrivate":"False"},{"Id":5,"WebSectionModelId":1,"Name":"Comparion Charts","Description":"Ecnomy charts to compare build orders","Href":"comparison-charts","IsPrivate":"True"},{"Id":6,"WebSectionModelId":2,"Name":"Notes","Description":"General player notes","Href":"notes","IsPrivate":"False"},{"Id":7,"WebSectionModelId":2,"Name":"Key Mapping","Description":"General key mapping info","Href":"keymapping","IsPrivate":"True"},{"Id":8,"WebSectionModelId":4,"Name":"Road Map","Description":"Plans for this website","Href":"roadmap","IsPrivate":"False"},{"Id":9,"WebSectionModelId":4,"Name":"Change Log","Description":"Past updates to the website","Href":"changelog","IsPrivate":"False"},{"Id":10,"WebSectionModelId":4,"Name":"Agile","Description":"Showing agile view of this website","Href":"agile","IsPrivate":"False"},{"Id":11,"WebSectionModelId":4,"Name":"Making Of","Description":"Explaining development details of this website","Href":"makingof","IsPrivate":"False"},{"Id":12,"WebSectionModelId":2,"Name":"Documentation","Description":"Explaining how to use this website","Href":"documentation","IsPrivate":"True"},{"Id":13,"WebSectionModelId":3,"Name":"About","Description":"Answering general questions on the website","Href":"about","IsPrivate":"False"},{"Id":14,"WebSectionModelId":3,"Name":"Contact","Description":"My contact info","Href":"contact","IsPrivate":"False"},{"Id":15,"WebSectionModelId":3,"Name":"Streams","Description":"Stream info","Href":"streams","IsPrivate":"False"},{"Id":16,"WebSectionModelId":4,"Name":"Documentation","Description":"Development information","Href":"docs","IsPrivate":"False"}]

23
Model/Entity/Data/DATA.cs

@ -1562,6 +1562,18 @@ public class DATA {
},
// Passives
// Aru Passives
//PASSIVE_ThrumAttackSpeed
{
DataType.PASSIVE_ThrumAttackSpeed,
new EntityModel(DataType.PASSIVE_ThrumAttackSpeed, EntityType.Passive)
.AddPart(new EntityInfoModel {
Name = "Thrum Attack Speed Boost", Descriptive = DescriptiveType.Ability,
Description =
@"Thrums gain more attack speed for a short duration when a near by allied Thrum kills an enemy unit"
})
.AddPart(new EntityFactionModel { Faction = FactionType.Aru })
},
{
DataType.PASSIVE_XacalDamage,
new EntityModel(DataType.PASSIVE_XacalDamage, EntityType.Passive)
@ -1743,6 +1755,17 @@ public class DATA {
},
// Abilities
// Aru
{
DataType.ABILITY_MobilizeAru,
new EntityModel(DataType.ABILITY_MobilizeAru, EntityType.Ability)
.AddPart(new EntityInfoModel {
Name = "Mobilize Aru", Descriptive = DescriptiveType.Ability,
Description =
@"Mobilize all deployed Aru units."
})
.AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "D" })
.AddPart(new EntityFactionModel { Faction = FactionType.Aru })
},
{
DataType.ABILITY_Offering,
new EntityModel(DataType.ABILITY_Offering, EntityType.Ability)

7
Model/Entity/Data/EntityType.cs

@ -1,4 +1,6 @@
namespace Model.Immortal.Entity.Data;
using System;
namespace Model.Immortal.Entity.Data;
public static class EntityType {
public static string None = "None";
@ -7,12 +9,13 @@ public static class EntityType {
public static string Family = "Family";
public static string Faction = "Faction";
public static string Command = "Command";
public static string Worker = "Worker";
public static string Army = "Army";
public static string Building = "Building";
public static string Building_Upgrade = "Building_Upgrade";
public static string Immortal = "Immortal";
public static string Pyre_Spell = "Pyre_Spell";
public static string Pyre_Spell = "Spell";
public static string Pyre_Event = "Pyre_Event";
public static string Ability = "Ability";
public static string Tech = "Tech";

12
Services/Development/AgileService.cs

@ -5,13 +5,17 @@ using Contexts;
using Microsoft.EntityFrameworkCore;
using Model.Work.Tasks;
namespace Services.Work;
namespace Services.Development;
public class AgileService : IAgileService {
private readonly HttpClient httpClient;
private bool isLoaded;
private event Action _onChange;
public AgileService(HttpClient httpClient) {
this.httpClient = httpClient;
}
@ -46,8 +50,8 @@ public class AgileService : IAgileService {
return;
}
SprintModels = (await httpClient.GetFromJsonAsync<SprintModel[]>("generated/SprintModels.json")).ToList();
TaskModels =(await httpClient.GetFromJsonAsync<TaskModel[]>("generated/TaskModels.json")).ToList();
SprintModels = (await httpClient.GetFromJsonAsync<SprintModel[]>("generated/SprintModels.json")?? Array.Empty<SprintModel>() ).ToList();
TaskModels =(await httpClient.GetFromJsonAsync<TaskModel[]>("generated/TaskModels.json") ?? Array.Empty<TaskModel>()).ToList();
isLoaded = true;
@ -76,8 +80,6 @@ public class AgileService : IAgileService {
NotifyDataChanged();
}
private event Action _onChange;
private void NotifyDataChanged() {
_onChange?.Invoke();
}

71
Services/Development/DocumentationService.cs

@ -0,0 +1,71 @@
using System.Net.Http.Json;
using Model.Documentation;
#if NO_SQL
#else
using Contexts;
using Microsoft.EntityFrameworkCore;
#endif
namespace Services.Development;
public class DocumentationService : IDocumentationService
{
private readonly HttpClient httpClient;
private bool isLoaded;
private event Action _onChange;
public DocumentationService(HttpClient httpClient)
{
this.httpClient = httpClient;
}
public List<DocumentationModel> DocumentationModels { get; set; }
public void Subscribe(Action action)
{
_onChange += action;
}
public void Unsubscribe(Action action)
{
_onChange -= action;
}
public bool IsLoaded()
{
return isLoaded;
}
public async Task Load()
{
if (isLoaded) return;
DocumentationModels =
(await httpClient.GetFromJsonAsync<DocumentationModel[]>("generated/DocumentationModels.json") ?? Array.Empty<DocumentationModel>()).ToList();
isLoaded = true;
NotifyDataChanged();
}
public void Update()
{
NotifyDataChanged();
}
private void NotifyDataChanged()
{
_onChange?.Invoke();
}
}

10
Services/Development/GitService.cs

@ -1,6 +1,4 @@

using System.Net.Http.Json;
using System.Net.Http.Json;
using Model.Work.Git;
#if NO_SQL
@ -10,7 +8,7 @@ using Contexts;
using Microsoft.EntityFrameworkCore;
#endif
namespace Services.Work;
namespace Services.Development;
public class GitService : IGitService {
private readonly HttpClient httpClient;
@ -53,8 +51,8 @@ public class GitService : IGitService {
return;
}
ChangeModels = (await httpClient.GetFromJsonAsync<ChangeModel[]>("generated/ChangeModels.json")).ToList();
PatchModels = (await httpClient.GetFromJsonAsync<PatchModel[]>("generated/PatchModels.json")).ToList();
ChangeModels = (await httpClient.GetFromJsonAsync<ChangeModel[]>("generated/ChangeModels.json") ?? Array.Empty<ChangeModel>()).ToList();
PatchModels = (await httpClient.GetFromJsonAsync<PatchModel[]>("generated/PatchModels.json") ?? Array.Empty<PatchModel>()).ToList();
isLoaded = true;

9
Services/Development/NoteService.cs

@ -1,8 +1,5 @@

using System.Net.Http.Json;
using System.Net.Http.Json;
using Model.Immortal.Notes;
using Model.Work.Git;
#if NO_SQL
@ -11,7 +8,7 @@ using Contexts;
using Microsoft.EntityFrameworkCore;
#endif
namespace Services.Work;
namespace Services.Development;
public class NoteService : INoteService {
private readonly HttpClient httpClient;
@ -52,7 +49,7 @@ public class NoteService : INoteService {
return;
}
NoteModels = (await httpClient.GetFromJsonAsync<NoteModel[]>("generated/NoteModels.json")).ToList();
NoteModels = (await httpClient.GetFromJsonAsync<NoteModel[]>("generated/NoteModels.json") ?? Array.Empty<NoteModel>()).ToList();
isLoaded = true;

11
Services/IServices.cs

@ -5,6 +5,7 @@
using Contexts;
using Microsoft.EntityFrameworkCore;
#endif
using Model.Documentation;
using Model.Immortal.BuildOrders;
using Model.Immortal.Economy;
using Model.Immortal.Entity;
@ -92,6 +93,16 @@ public interface INoteService {
public bool IsLoaded();
}
public interface IDocumentationService {
public List<DocumentationModel> DocumentationModels { get; set; }
public void Subscribe(Action action);
public void Unsubscribe(Action action);
public void Update();
public Task Load();
public bool IsLoaded();
}
public interface IGitService {
#if NO_SQL

8
Services/Immortal/EntityFilterService.cs

@ -142,7 +142,7 @@ public class EntityFilterService : IEntityFilterService {
private void RefreshEntityChoices() {
_entityChoices.Clear();
if (_selectedFaction == FactionType.QRath || _selectedFaction == FactionType.Aru) {
if (_selectedFaction == FactionType.QRath || _selectedFaction == FactionType.Aru || _selectedFaction == FactionType.Any) {
_entityChoices.Add(EntityType.Army);
_entityChoices.Add(EntityType.Immortal);
_entityChoices.Add(EntityType.Passive);
@ -150,16 +150,10 @@ public class EntityFilterService : IEntityFilterService {
_entityChoices.Add(EntityType.Tech);
_entityChoices.Add(EntityType.Ability);
_entityChoices.Add(EntityType.Pyre_Spell);
_entityChoices.Add(EntityType.Building_Upgrade);
_entityChoices.Add(EntityType.Worker);
}
if (_selectedFaction == FactionType.Any) {
_entityChoices.Add(EntityType.Teapot);
_entityChoices.Add(EntityType.Command);
_entityChoices.Add(EntityType.Pyre_Event);
_entityChoices.Add(EntityType.Family);
_entityChoices.Add(EntityType.Faction);
_entityChoices.Add(EntityType.Any);
}
}

2
Services/Website/WebsiteService.cs

@ -7,7 +7,7 @@ using Microsoft.EntityFrameworkCore;
using Model.Website;
namespace Services.Work;
namespace Services.Development;
public class WebsiteService : IWebsiteService {
private readonly HttpClient httpClient;

Loading…
Cancel
Save