Browse Source

Auto formatting

main
Jonathan McCaffrey 4 years ago
parent
commit
b2516fc80a
  1. 16
      Components/Components.csproj
  2. 2
      Components/Form/FormNumberComponent.razor
  3. 17
      Components/Form/FormToggleComponent.razor
  4. 2
      Components/Inputs/CodeLinkComponent.razor
  5. 6
      Components/Inputs/LinkButtonComponent.razor
  6. 3
      Components/Inputs/SearchButtonComponent.razor
  7. 2
      Components/Inputs/SearchIconButtonComponent.razor
  8. 7
      Components/Navigation/DesktopNavComponent.razor
  9. 5
      Components/Navigation/MobileNavComponent.razor
  10. 2
      Components/Navigation/TabletNavComponent.razor
  11. 5
      Components/Utils/Links.cs
  12. 12
      IGP/Dialog/SearchDialogComponent.razor
  13. 11
      IGP/Pages/BasePage.razor
  14. 9
      IGP/Pages/BuildCalculator/BuildCalculatorPage.razor
  15. 42
      IGP/Pages/BuildCalculator/Parts/ArmyComponent.razor
  16. 15
      IGP/Pages/BuildCalculator/Parts/BuildChartComponent.razor
  17. 5
      IGP/Pages/BuildCalculator/Parts/EntityClickViewComponent.razor
  18. 32
      IGP/Pages/BuildCalculator/Parts/FilterComponent.razor
  19. 2
      IGP/Pages/BuildCalculator/Parts/HighlightsComponent.razor
  20. 165
      IGP/Pages/BuildCalculator/Parts/HotkeyViewerComponent.razor
  21. 6
      IGP/Pages/BuildCalculator/Parts/InputPanelComponent.razor
  22. 7
      IGP/Pages/BuildCalculator/Parts/OptionsComponent.razor
  23. 2
      IGP/Pages/BuildCalculator/Parts/TimingComponent.razor
  24. 4
      IGP/Pages/Database/DatabaseSinglePage.razor
  25. 11
      IGP/Pages/Database/Parts/EntityFilterComponent.razor
  26. 4
      IGP/Pages/Documentation/Parts/DocumentComponent.razor
  27. 4
      IGP/Pages/EconomyComparison/EconomyComparisonPage.razor
  28. 12
      IGP/Pages/EconomyComparison/Parts/ChartComponent.razor
  29. 15
      IGP/Pages/EconomyComparison/Parts/EconomyDifferenceComponent.razor
  30. 20
      IGP/Pages/EconomyComparison/Parts/EconomyInputComponent.razor
  31. 190
      IGP/Pages/HarassCalculatorPage.razor
  32. 2
      IGP/Pages/Notes/NotesIndexPage.razor
  33. 2
      IGP/Pages/Notes/NotesPage.razor
  34. 9
      IGP/Pages/PermissionsPage.razor
  35. 24
      IGP/Pages/StoragePage.razor
  36. 22
      IGP/Pages/StreamsPage.razor
  37. 1
      IGP/Portals/SearchPortal.razor
  38. 2
      Model/BuildOrders/BuildOrderModel.cs
  39. 2
      Model/Chart/PointModel.cs
  40. 241
      Model/Entity/Data/DATA.cs
  41. 17
      Model/Entity/Data/Ids_Entity.cs
  42. 1
      Model/Entity/Parts/EntityFactionModel.cs
  43. 12
      Model/Hotkeys/HotkeyModel.cs
  44. 4
      Model/Model.csproj
  45. 1
      Model/Website/WebPageModel.cs
  46. 2
      Model/Website/WebSectionModel.cs
  47. 1
      Services/IServices.cs
  48. 17
      Services/Immortal/BuildOrderService.cs
  49. 5
      Services/Immortal/EntityFilterService.cs
  50. 7
      Services/Immortal/ImmortalSelectionService.cs
  51. 12
      Services/Services.csproj
  52. 25
      Services/Website/DataCollectionService.cs
  53. 11
      Services/Website/DialogService.cs
  54. 4
      Services/Website/PermissionService.cs
  55. 8
      Services/Website/SearchService.cs
  56. 1
      Services/Website/StorageService.cs
  57. 5
      TestAutomation/BaseTest.cs
  58. 34
      TestAutomation/Pages/DatabasePage.cs
  59. 15
      TestAutomation/Pages/DatabaseSinglePage.cs
  60. 8
      TestAutomation/Shared/NavigationBar.cs
  61. 3
      TestAutomation/Shared/WebsiteSearchDialog.cs
  62. 22
      TestAutomation/TestAutomation.csproj
  63. 48
      TestAutomation/TestSearchFeatures.cs
  64. 32
      TestAutomation/Utils/Website.cs

16
Components/Components.csproj

@ -15,24 +15,24 @@
</PropertyGroup>
<ItemGroup>
<SupportedPlatform Include="browser" />
<SupportedPlatform Include="browser"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Markdig" Version="0.28.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.0-preview.2.22153.2" />
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.0-preview.2.22153.2" />
<PackageReference Include="Markdig" Version="0.28.1"/>
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.0-preview.2.22153.2"/>
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.0-preview.2.22153.2"/>
</ItemGroup>
<ItemGroup>
<Folder Include="Inputs\" />
<Folder Include="Inputs\"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Model\Model.csproj" />
<ProjectReference Include="..\Services\Services.csproj" />
<ProjectReference Include="..\Model\Model.csproj"/>
<ProjectReference Include="..\Services\Services.csproj"/>
</ItemGroup>
<ItemGroup>
<None Remove="Inputs\" />
<None Remove="Inputs\"/>
</ItemGroup>
</Project>

2
Components/Form/FormNumberComponent.razor

@ -5,7 +5,7 @@
}
<div>
<input readonly="@ReadOnly"
id="@Id"
id="@Id"
class="numberInput"
type="number"
min="@Min"

17
Components/Form/FormToggleComponent.razor

@ -4,14 +4,14 @@
@Label:
</div>
<label class="switch">
<input readonly="@ReadOnly"
type="checkbox"
id="@labelId"
class="@ClassStyle"
checked="@Value"
@oninput="OnChange"/>
<input readonly="@ReadOnly"
type="checkbox"
id="@labelId"
class="@ClassStyle"
checked="@Value"
@oninput="OnChange"/>
<span class="slider"></span>
<span class="slider"></span>
</label>
</div>
@if (Info != "")
@ -116,10 +116,11 @@
private string labelId = "";
private string ClassStyle => Value ? "checked" : "";
protected override void OnInitialized()
{
base.OnInitialized();
labelId = Label.ToLower().Replace(" ", "_");
}
}

2
Components/Inputs/CodeLinkComponent.razor

@ -1,4 +1,4 @@
<a href="@Href" target="_blank" class="codeLinkButton">
<a href="@Href" target="_blank" class="codeLinkButton">
View on GitHub <i class="fa-brands fa-github" style="font-size: 24px; margin-left: 5px;"></i>
</a>

6
Components/Inputs/LinkButtonComponent.razor

@ -1,4 +1,4 @@
<a href="@Href" class="linkButtonContainer" >
<a href="@Href" class="linkButtonContainer">
@ChildContent
</a>
@ -27,9 +27,9 @@
[Parameter]
public RenderFragment ChildContent { get; set; } = default!;
[Parameter]
public string Href { get; set; } = "";
}

3
Components/Inputs/SearchButtonComponent.razor

@ -15,7 +15,7 @@
{
<span>CTRL + K</span>
}
</div>
</button>
@ -44,6 +44,7 @@
</style>
@code {
[Parameter]
public RenderFragment ChildContent { get; set; } = default!;

2
Components/Inputs/SearchIconButtonComponent.razor

@ -28,6 +28,7 @@
</style>
@code {
[Parameter]
public RenderFragment ChildContent { get; set; } = default!;
@ -38,4 +39,5 @@
{
SearchService.Show();
}
}

7
Components/Navigation/DesktopNavComponent.razor

@ -27,13 +27,14 @@
}
<div class="sectionNav">
<button onclick="@(() => { MenuClicked(webSection.Id); })" class="@sectionButtonStyle"><i class="fa-solid @webSection.Icon"></i>
<button onclick="@(() => { MenuClicked(webSection.Id); })" class="@sectionButtonStyle">
<i class="fa-solid @webSection.Icon"></i>
@if (!webSection.OnlyIcon)
{
<span style="margin-left: 12px">@webSection.Name</span>
}
</button>
</button>
@if (isSelected)
{
<div class="navMenuPosition">

5
Components/Navigation/MobileNavComponent.razor

@ -1,7 +1,4 @@

<div class="mobileFooter">
<div class="mobileFooter">
<div class="mobileNavSectionsContainer">
@foreach (var webSection in WebSections)
{

2
Components/Navigation/TabletNavComponent.razor

@ -6,7 +6,7 @@
IGP Fan Reference
</div>
<div class="tabletButtons">
<SearchButtonComponent/>
<div class="tabletButton">
<div class="tabletMenuTitle">

5
Components/Utils/Links.cs

@ -4,10 +4,7 @@ public static class Links
{
public static string GetTarget(string link)
{
if (link.StartsWith("https://"))
{
return "_blank";
}
if (link.StartsWith("https://")) return "_blank";
return "_self";
}

12
IGP/Dialog/SearchDialogComponent.razor

@ -1,5 +1,4 @@
@using System.Timers
@implements IDisposable;
@implements IDisposable;
@inject ISearchService searchService
@inject IJSRuntime jsRuntime
@ -41,7 +40,7 @@
</button>
@if (!searchPoint.Summary.Trim().Equals(""))
{
<i> - @searchPoint.Summary</i>
<i> - @searchPoint.Summary</i>
}
</div>
}
@ -141,7 +140,7 @@
protected override void OnInitialized()
{
searchService.Subscribe(OnSearchChanged);
timer = new Timer(200);
timer.Elapsed += FocusTimer;
timer.Enabled = false;
@ -153,15 +152,16 @@
jsRuntime.InvokeVoidAsync("SetFocusToElement", "searchInput");
StateHasChanged();
}
private Timer timer = null!;
private void OnSearchChanged()
{
if (timer.Enabled != searchService.IsVisible)
{
timer.Enabled = searchService.IsVisible;
}
StateHasChanged();
StateHasChanged();
}
public void Dispose()

11
IGP/Pages/BasePage.razor

@ -1,5 +1,4 @@
@using Services.Website
@inject IDataCollectionService DataCollectionService
@inject NavigationManager NavigationManager
@ -12,26 +11,26 @@
CollectLoadedPage();
}
private void CollectLoadedPage()
{
var skipBaseUri = NavigationManager.Uri.Substring(NavigationManager.BaseUri.Length,
NavigationManager.Uri.Length - NavigationManager.BaseUri.Length);
var splitData = skipBaseUri.Split("/");
var rootUrl = splitData.First();
if (rootUrl.Trim().Equals(""))
{
rootUrl = "home";
}
var eventData = new Dictionary<string, string> { { "page", rootUrl }};
var eventData = new Dictionary<string, string> { { "page", rootUrl } };
if (splitData.Length > 1)
{
eventData["inner-page"] = splitData.Last();
}
DataCollectionService.SendEvent(DataCollectionKeys.PageInitialized, eventData);
}

9
IGP/Pages/BuildCalculator/BuildCalculatorPage.razor

@ -13,7 +13,6 @@
@inject IDataCollectionService DataCollectionService
@page "/build-calculator"
@using Services.Website
@implements IDisposable
@ -221,14 +220,14 @@
protected override void OnInitialized()
{
base.OnInitialized();
EconomyService.Calculate(BuildOrderService, TimingService, 0);
KeyService.Subscribe(HandleClick);
DataCollectionService.SendEvent(
DataCollectionKeys.PageInitialized,
new Dictionary<string, string> {{"page", "build-calculator"}}
DataCollectionKeys.PageInitialized,
new Dictionary<string, string> { { "page", "build-calculator" } }
);
}

42
IGP/Pages/BuildCalculator/Parts/ArmyComponent.razor

@ -19,7 +19,8 @@
<FormDisplayComponent Label="Army units built">
<Display>
<div class="armyCardsContainer">
@foreach (var unit in armyCount) {
@foreach (var unit in armyCount)
{
<div class="armyCard">
<div class="armyCountPosition">
<div class="armyCount">@unit.Value.ToString()x</div>
@ -72,33 +73,39 @@
List<EntityModel> army = new();
protected override void OnInitialized() {
protected override void OnInitialized()
{
base.OnInitialized();
buildOrder.Subscribe(OnBuildOrderChanged);
timingService.Subscribe(StateHasChanged);
}
void IDisposable.Dispose() {
void IDisposable.Dispose()
{
buildOrder.Unsubscribe(OnBuildOrderChanged);
timingService.Unsubscribe(StateHasChanged);
}
protected override bool ShouldRender() {
protected override bool ShouldRender()
{
#if DEBUG
jsRuntime.InvokeVoidAsync("console.time", "ArmyComponent");
#endif
return true;
}
protected override void OnAfterRender(bool firstRender) {
protected override void OnAfterRender(bool firstRender)
{
#if DEBUG
jsRuntime.InvokeVoidAsync("console.timeEnd", "ArmyComponent");
#endif
}
void OnBuildOrderChanged() {
void OnBuildOrderChanged()
{
var armyCountWas = 0;
foreach (var army in armyCount) {
foreach (var army in armyCount)
{
armyCountWas += army.Value;
}
@ -108,14 +115,19 @@
var entitiesOverTime = buildOrder.GetOrders();
foreach (var entitiesAtTime in entitiesOverTime) {
foreach (var entity in entitiesAtTime.Value) {
if (entity.EntityType == EntityType.Army) {
if (!armyCount.TryAdd(entity.Info().Name, 1)) {
foreach (var entitiesAtTime in entitiesOverTime)
{
foreach (var entity in entitiesAtTime.Value)
{
if (entity.EntityType == EntityType.Army)
{
if (!armyCount.TryAdd(entity.Info().Name, 1))
{
armyCount[entity.Info().Name]++;
}
if (entity.Production() != null && entity.Production().BuildTime + entitiesAtTime.Key > lastInterval) {
if (entity.Production() != null && entity.Production().BuildTime + entitiesAtTime.Key > lastInterval)
{
lastInterval = entity.Production().BuildTime + entitiesAtTime.Key;
}
}
@ -124,12 +136,14 @@
//TODO Better
var armyCountIs = 0;
foreach (var army in armyCount) {
foreach (var army in armyCount)
{
armyCountIs += army.Value;
}
if (armyCountWas != armyCountIs) {
if (armyCountWas != armyCountIs)
{
StateHasChanged();
}
}

15
IGP/Pages/BuildCalculator/Parts/BuildChartComponent.razor

@ -13,20 +13,19 @@ else
<div class="chartsContainer">
@foreach (var chart in charts)
{
Dictionary<int, bool> takenPixels = new Dictionary<int, bool>();
var takenPixels = new Dictionary<int, bool>();
<div style="width: @chart.IntervalDisplayMax.ToString()px; height: @chart.ValueDisplayMax.ToString()px">
<div style="position: relative; border: 2px solid gray; border-radius:2px; width: @chart.IntervalDisplayMax.ToString()px; height: @chart.ValueDisplayMax.ToString()px">
@foreach (var point in chart.Points)
{
var x = int.Parse(point.GetInterval(chart.HighestIntervalPoint, chart.IntervalDisplayMax));
var x = int.Parse(point.GetInterval(chart.HighestIntervalPoint, chart.IntervalDisplayMax));
if (takenPixels.ContainsKey(x)) continue;
takenPixels.Add(x, true);
<div style="position: absolute;
bottom:@point.GetValue(chart.HighestValuePoint, chart.ValueDisplayMax)px;
left:@point.GetInterval(chart.HighestIntervalPoint, chart.IntervalDisplayMax)px;

5
IGP/Pages/BuildCalculator/Parts/EntityClickViewComponent.razor

@ -3,7 +3,6 @@
@inject IImmortalSelectionService FilterService
@inject IBuildOrderService BuildOrderService
@inject IStorageService StorageService
@using Services.Website
@implements IDisposable
@ -39,10 +38,10 @@
void IDisposable.Dispose()
{
KeyService.Unsubscribe(HandleClick);
StorageService.Unsubscribe(RefreshDefaults);
}
void RefreshDefaults()
{

32
IGP/Pages/BuildCalculator/Parts/FilterComponent.razor

@ -5,10 +5,14 @@
<FormSelectComponent OnChange="@OnFactionChanged">
<FormLabelComponent>Faction</FormLabelComponent>
<ChildContent>
<option value="@DataType.FACTION_Aru"
selected="@(FilterService.GetFaction().Equals(DataType.FACTION_Aru))">Aru</option>
<option value="@DataType.FACTION_QRath"
selected="@(FilterService.GetFaction().Equals(DataType.FACTION_QRath))">Q'Rath</option>
<option value="@DataType.FACTION_Aru"
selected="@(FilterService.GetFaction().Equals(DataType.FACTION_Aru))">
Aru
</option>
<option value="@DataType.FACTION_QRath"
selected="@(FilterService.GetFaction().Equals(DataType.FACTION_QRath))">
Q'Rath
</option>
</ChildContent>
</FormSelectComponent>
@ -17,17 +21,25 @@
<ChildContent>
@if (FilterService.GetFaction() == DataType.FACTION_QRath)
{
<option value="@DataType.IMMORTAL_Orzum"
selected="@(FilterService.GetImmortal().Equals(DataType.IMMORTAL_Orzum))">Orzum</option>
<option value="@DataType.IMMORTAL_Orzum"
selected="@(FilterService.GetImmortal().Equals(DataType.IMMORTAL_Orzum))">
Orzum
</option>
<option value="@DataType.IMMORTAL_Ajari"
selected="@(FilterService.GetImmortal().Equals(DataType.IMMORTAL_Ajari))">Ajari</option>
selected="@(FilterService.GetImmortal().Equals(DataType.IMMORTAL_Ajari))">
Ajari
</option>
}
@if (FilterService.GetFaction() == DataType.FACTION_Aru)
{
<option value="@DataType.IMMORTAL_Mala"
selected="@(FilterService.GetImmortal().Equals(DataType.IMMORTAL_Mala))">Mala</option>
<option value="@DataType.IMMORTAL_Mala"
selected="@(FilterService.GetImmortal().Equals(DataType.IMMORTAL_Mala))">
Mala
</option>
<option value="@DataType.IMMORTAL_Xol"
selected="@(FilterService.GetImmortal().Equals(DataType.IMMORTAL_Xol))">Xol</option>
selected="@(FilterService.GetImmortal().Equals(DataType.IMMORTAL_Xol))">
Xol
</option>
}
</ChildContent>
</FormSelectComponent>

2
IGP/Pages/BuildCalculator/Parts/HighlightsComponent.razor

@ -8,7 +8,7 @@
<div class="highlightsContainer">
<div>
<div>Requested</div>
@foreach (var ordersAtTime in buildOrderService.StartedOrders.Reverse())
{
foreach (var order in ordersAtTime.Value)

165
IGP/Pages/BuildCalculator/Parts/HotkeyViewerComponent.razor

@ -13,8 +13,10 @@
<InputPanelComponent>
<div class="keyContainer">
@foreach (var hotkey in hotkeys) {
if (hotkey.IsHidden) {
@foreach (var hotkey in hotkeys)
{
if (hotkey.IsHidden)
{
continue;
}
@ -31,14 +33,17 @@
var borderRadius = hotkey.PositionY == 0 ? 12 : 0;
var border = "1px solid black";
if (hotkey.KeyText.Equals(key)) {
if (hotkey.KeyText.Equals(key))
{
border = "5px solid black";
}
if (hotkey.KeyText.Equals(controlGroup)) {
if (hotkey.KeyText.Equals(controlGroup))
{
color = "#257525";
}
if (hotkey.KeyText.Equals("SPACE") && KeyService.IsHoldingSpace()) {
if (hotkey.KeyText.Equals("SPACE") && KeyService.IsHoldingSpace())
{
border = "5px solid green";
}
@ -77,23 +82,28 @@
<div @onclick="e => ButtonClicked(e, hotkey)" style="@usedStyle">
@keyText
@foreach (var entity in data.Values) {
if (InvalidKey(entity, hotkey) || InvalidKeyGroup(entity, hotkey) || InvalidHoldSpace(entity)) {
@foreach (var entity in data.Values)
{
if (InvalidKey(entity, hotkey) || InvalidKeyGroup(entity, hotkey) || InvalidHoldSpace(entity))
{
continue;
}
if (InvalidFaction(entity)) {
if (InvalidFaction(entity))
{
continue;
}
if (InvalidVanguard(entity) || InvalidNonVanguard(entity)) {
if (InvalidVanguard(entity) || InvalidNonVanguard(entity))
{
continue;
}
var isVanguard = entity.VanguardAdded() != null;
var style = isVanguard ? "font-weight: bold;" : "";
if (BuildOrderService.WillMeetRequirements(entity) == null) {
if (BuildOrderService.WillMeetRequirements(entity) == null)
{
style += "color:gray; font-style: italic;";
}
@ -137,7 +147,8 @@
private string controlGroup = "C";
private string key = "";
protected override void OnInitialized() {
protected override void OnInitialized()
{
base.OnInitialized();
KeyService.Subscribe(OnKeyPressed);
@ -145,7 +156,8 @@
BuildOrderService.Subscribe(OnBuilderOrderChanged);
}
void IDisposable.Dispose() {
void IDisposable.Dispose()
{
KeyService.Unsubscribe(OnKeyPressed);
FilterService.Unsubscribe(StateHasChanged);
BuildOrderService.Unsubscribe(OnBuilderOrderChanged);
@ -153,14 +165,17 @@
int completedTimeCount = 0;
void OnBuilderOrderChanged() {
if (BuildOrderService.UniqueCompletedTimes.Count != completedTimeCount) {
void OnBuilderOrderChanged()
{
if (BuildOrderService.UniqueCompletedTimes.Count != completedTimeCount)
{
completedTimeCount = BuildOrderService.UniqueCompletedTimes.Count;
StateHasChanged();
}
}
protected override bool ShouldRender() {
protected override bool ShouldRender()
{
#if DEBUG
JsRuntime.InvokeVoidAsync("console.time", "HotKeyViewerComponent");
#endif
@ -168,15 +183,18 @@
return true;
}
protected override void OnAfterRender(bool firstRender) {
protected override void OnAfterRender(bool firstRender)
{
#if DEBUG
JsRuntime.InvokeVoidAsync("console.timeEnd", "HotKeyViewerComponent");
#endif
}
// Move to Filter Service
bool InvalidFaction(EntityModel entity) {
if (entity.Faction() != null && entity.Faction()?.Faction != FilterService.GetFaction() && FilterService.GetFaction() != DataType.Any) {
bool InvalidFaction(EntityModel entity)
{
if (entity.Faction() != null && entity.Faction()?.Faction != FilterService.GetFaction() && FilterService.GetFaction() != DataType.Any)
{
return true;
}
@ -184,10 +202,12 @@
}
// Move to Filter Service
bool InvalidVanguard(EntityModel entity) {
bool InvalidVanguard(EntityModel entity)
{
if (entity.VanguardAdded() != null
&& entity.VanguardAdded()?.ImmortalId != FilterService.GetImmortal()
&& FilterService.GetImmortal() != DataType.Any) {
&& FilterService.GetImmortal() != DataType.Any)
{
return true;
}
@ -195,10 +215,14 @@
}
// Move to Filter Service
bool InvalidNonVanguard(EntityModel entity) {
if (entity.Replaceds().Count > 0) {
foreach (var replaced in entity.Replaceds()) {
if (FilterService.GetImmortal() == replaced.ImmortalId) {
bool InvalidNonVanguard(EntityModel entity)
{
if (entity.Replaceds().Count > 0)
{
foreach (var replaced in entity.Replaceds())
{
if (FilterService.GetImmortal() == replaced.ImmortalId)
{
return true;
}
}
@ -207,90 +231,114 @@
return false;
}
bool InvalidKey(EntityModel entity, HotkeyModel key) {
if (entity.Hotkey()?.Hotkey == key.KeyText) {
bool InvalidKey(EntityModel entity, HotkeyModel key)
{
if (entity.Hotkey()?.Hotkey == key.KeyText)
{
return false;
}
return true;
}
bool InvalidKeyGroup(EntityModel entity, HotkeyModel key) {
if (entity.Hotkey()?.HotkeyGroup == controlGroup) {
bool InvalidKeyGroup(EntityModel entity, HotkeyModel key)
{
if (entity.Hotkey()?.HotkeyGroup == controlGroup)
{
return false;
}
return true;
}
bool InvalidKey(EntityModel entity) {
if (entity.Hotkey()?.Hotkey == key) {
bool InvalidKey(EntityModel entity)
{
if (entity.Hotkey()?.Hotkey == key)
{
return false;
}
return true;
}
bool InvalidKeyGroup(EntityModel entity) {
if (entity.Hotkey()?.HotkeyGroup == controlGroup) {
bool InvalidKeyGroup(EntityModel entity)
{
if (entity.Hotkey()?.HotkeyGroup == controlGroup)
{
return false;
}
return true;
}
bool InvalidHoldSpace(EntityModel entity) {
if (entity.Hotkey()?.HoldSpace == KeyService.IsHoldingSpace()) {
bool InvalidHoldSpace(EntityModel entity)
{
if (entity.Hotkey()?.HoldSpace == KeyService.IsHoldingSpace())
{
return false;
}
return true;
}
void OnKeyPressed() {
void OnKeyPressed()
{
var controlGroupWas = controlGroup;
var keyWas = key;
if (KeyService.GetAllPressedKeys().Contains("Z")) {
if (KeyService.GetAllPressedKeys().Contains("Z"))
{
controlGroup = "Z";
}
if (KeyService.GetAllPressedKeys().Contains("TAB")) {
if (KeyService.GetAllPressedKeys().Contains("TAB"))
{
controlGroup = "TAB";
}
if (KeyService.GetAllPressedKeys().Contains("C")) {
if (KeyService.GetAllPressedKeys().Contains("C"))
{
controlGroup = "C";
}
if (KeyService.GetAllPressedKeys().Contains("D")) {
if (KeyService.GetAllPressedKeys().Contains("D"))
{
controlGroup = "D";
}
if (KeyService.GetAllPressedKeys().Contains("V")) {
if (KeyService.GetAllPressedKeys().Contains("V"))
{
controlGroup = "V";
}
if (KeyService.GetAllPressedKeys().Contains("ALT")) {
if (KeyService.GetAllPressedKeys().Contains("ALT"))
{
controlGroup = "ALT";
}
if (KeyService.GetAllPressedKeys().Contains("SHIFT")) {
if (KeyService.GetAllPressedKeys().Contains("SHIFT"))
{
controlGroup = "SHIFT";
}
if (KeyService.GetAllPressedKeys().Contains("CONTROL")) {
if (KeyService.GetAllPressedKeys().Contains("CONTROL"))
{
controlGroup = "CONTROL";
}
if (KeyService.GetAllPressedKeys().Count > 0) {
if (KeyService.GetAllPressedKeys().Count > 0)
{
key = KeyService.GetAllPressedKeys().First();
}
if (controlGroupWas != controlGroup || keyWas != key) {
if (controlGroupWas != controlGroup || keyWas != key)
{
StateHasChanged();
}
}
private void HandleClick() {
private void HandleClick()
{
var hotkey = KeyService.GetHotkey();
if (hotkey == "") {
if (hotkey == "")
{
return;
}
if (hotkey == "`") {
if (hotkey == "`")
{
BuildOrderService.RemoveLast();
EconomyService.Calculate(BuildOrderService, TimingService, BuildOrderService.GetLastRequestInterval());
return;
@ -303,31 +351,38 @@
var entity = EntityModel.GetFrom(hotkey!, hotkeyGroup, isHoldSpace, faction, immortal);
if (entity == null) {
if (entity == null)
{
return;
}
if (BuildOrderService.Add(entity, EconomyService)) {
if (BuildOrderService.Add(entity, EconomyService))
{
EconomyService.Calculate(BuildOrderService, TimingService, BuildOrderService.GetLastRequestInterval());
}
}
private void ButtonClicked(MouseEventArgs mouseEventArgs, HotkeyModel hotkey) {
private void ButtonClicked(MouseEventArgs mouseEventArgs, HotkeyModel hotkey)
{
DataCollectionService.SendEvent(
DataCollectionKeys.BuildCalcInput,
new Dictionary<string, string> { { "key", hotkey.KeyText.ToLower() }, { "input-source", "mouse" } }
);
if (hotkey.KeyText.Equals(HotKeyType.SPACE.ToString())) {
if (KeyService.IsHoldingSpace()) {
if (hotkey.KeyText.Equals(HotKeyType.SPACE.ToString()))
{
if (KeyService.IsHoldingSpace())
{
KeyService.RemovePressedKey(hotkey.KeyText);
}
else {
else
{
KeyService.AddPressedKey(hotkey.KeyText);
}
}
else {
else
{
KeyService.AddPressedKey(hotkey.KeyText);
KeyService.RemovePressedKey(hotkey.KeyText);
}

6
IGP/Pages/BuildCalculator/Parts/InputPanelComponent.razor

@ -22,10 +22,10 @@
private void HandleKeyDown(KeyboardEventArgs e)
{
DataCollectionService.SendEvent(
DataCollectionKeys.BuildCalcInput,
new Dictionary<string, string> {{"key", e.Key.ToLower()}, {"input-source", "keyboard"}}
DataCollectionKeys.BuildCalcInput,
new Dictionary<string, string> { { "key", e.Key.ToLower() }, { "input-source", "keyboard" } }
);
KeyService.AddPressedKey(e.Key);
}

7
IGP/Pages/BuildCalculator/Parts/OptionsComponent.razor

@ -4,8 +4,6 @@
@inject IEconomyService EconomyService
@inject IToastService ToastService
@inject ITimingService TimingService
@using System.Data
@implements IDisposable
<FormLayoutComponent>
@ -57,7 +55,7 @@
RefreshDefaults();
}
void IDisposable.Dispose()
{
TimingService.Unsubscribe(RefreshDefaults);
@ -70,7 +68,6 @@
WaitTo = TimingService.WaitTo;
StateHasChanged();
}
void OnBuildingInputDelayChanged(ChangeEventArgs changeEventArgs)
@ -83,7 +80,7 @@
TimingService.WaitTime = (int)changeEventArgs.Value!;
WaitTime = (int)changeEventArgs.Value!;
}
void OnWaitToChanged(ChangeEventArgs changeEventArgs)
{
TimingService.WaitTo = (int)changeEventArgs.Value!;

2
IGP/Pages/BuildCalculator/Parts/TimingComponent.razor

@ -36,7 +36,7 @@
base.OnInitialized();
timingService.Subscribe(StateHasChanged);
}
void IDisposable.Dispose()
{
timingService.Unsubscribe(StateHasChanged);

4
IGP/Pages/Database/DatabaseSinglePage.razor

@ -75,10 +75,10 @@
{
base.OnParametersSet();
base.OnInitialized();
FocusEntity();
}
private void FocusEntity()
{
foreach (var e in DATA.Get().Values)

11
IGP/Pages/Database/Parts/EntityFilterComponent.razor

@ -9,11 +9,12 @@
{
styleClass = "selected";
}
<button @onclick="@(e => OnChangeFaction(choice))"
class="choiceButton @styleClass">@(choice == DataType.Any
? DataType.Any
: DATA.Get()[choice].Info().Name)
</button>
<button @onclick="@(e => OnChangeFaction(choice))"
class="choiceButton @styleClass">
@(choice == DataType.Any
? DataType.Any
: DATA.Get()[choice].Info().Name)
</button>
}
</div>

4
IGP/Pages/Documentation/Parts/DocumentComponent.razor

@ -18,7 +18,7 @@ else
<div class="docFooter">
<LinkButtonComponent Href="@GitUrl">
Edit on GitHub <i class="fa-brands fa-github" style="font-size: 24px; margin-left: 5px;"></i>
</LinkButtonComponent>
</LinkButtonComponent>
</div>
</div>
}
@ -59,7 +59,7 @@ else
public DocContentModel DocContentModel { get; set; } = default!;
DocFrontMatterModel docFrontMatter = null!;
private string? content = null;
private string? content;
private string Filepath => $"content/docs/{DocContentModel.Content}.md";
private string GitUrl => $"{Project.GitResourcesUrl}/{Filepath}";

4
IGP/Pages/EconomyComparison/EconomyComparisonPage.razor

@ -8,7 +8,7 @@
<LayoutMediumContentComponent>
<WebsiteTitleComponent>Economy Comparision</WebsiteTitleComponent>
<PaperComponent>
<div>You</div>
<EconomyInputComponent ForPlayer="0"/>
@ -42,6 +42,7 @@
</LayoutMediumContentComponent>
@code {
protected override void OnInitialized()
{
base.OnInitialized();
@ -52,4 +53,5 @@
{
EconomyComparisonService.Unsubscribe(StateHasChanged);
}
}

12
IGP/Pages/EconomyComparison/Parts/ChartComponent.razor

@ -17,7 +17,7 @@
@foreach (var point in chart.Points)
{
var xCoord = point.GetInterval(chart.HighestIntervalPoint, chart.IntervalDisplayMax);
var show = int.Parse(xCoord) / 6 % 2;
var player = index - 1;
@ -79,18 +79,17 @@
void OnBuilderOrderChanged()
{
charts = new List<ChartModel>();
var index = 0;
highestAlloyPoint = 0;
foreach (var buildToCompare in economyComparisonService.BuildsToCompare)
{
GenerateChart(index++, buildToCompare);
}
StateHasChanged();
}
@ -124,7 +123,6 @@
};
for (var interval = 0; interval < economyOverTime.Count(); interval++)
{
var alloyPoint = new PointModel { Interval = interval };

15
IGP/Pages/EconomyComparison/Parts/EconomyDifferenceComponent.razor

@ -63,13 +63,13 @@
@code {
private int StartingAdvantageAtTime = 0;
private int PeakAdvantageByAlloy = 0;
private int PeakAdvantageAtTime = 0;
private int WorseningTime = 0;
private int MiracleTime = 0;
protected override void OnInitialized()
{
base.OnInitialized();
@ -87,8 +87,8 @@
StartingAdvantageAtTime = 0;
WorseningTime = 0;
MiracleTime = 0;
for (int interval = 0; interval < economyComparisonService.BuildsToCompare[0].EconomyOverTimeModel.Count; interval++)
for (var interval = 0; interval < economyComparisonService.BuildsToCompare[0].EconomyOverTimeModel.Count; interval++)
{
var yourEconomy = economyComparisonService.BuildsToCompare[0].EconomyOverTimeModel[interval];
var theirEconomy = economyComparisonService.BuildsToCompare[1].EconomyOverTimeModel[interval];
@ -109,16 +109,15 @@
}
else
{
if (PeakAdvantageByAlloy > 0 && WorseningTime == 0)
{
WorseningTime = interval;
}
}
if (deltaEconomy < -1000 && MiracleTime == 0)
{
MiracleTime = interval;
}
}
}
}

20
IGP/Pages/EconomyComparison/Parts/EconomyInputComponent.razor

@ -14,22 +14,22 @@
<FormLabelComponent>Number of TownHall Expansions</FormLabelComponent>
</FormNumberComponent>
<ContentDividerComponent/>
@{
var index = 0;
}
@foreach (var timing in TownHallTimings)
{
index++;
<FormNumberComponent Value="@timing" OnChange="(e)=> ChangeBuildTime(e, index - 1)">
<FormLabelComponent>
TownHall build time
</FormLabelComponent>
</FormNumberComponent>
}
<FormNumberComponent Value="@timing" OnChange="e => ChangeBuildTime(e, index - 1)">
<FormLabelComponent>
TownHall build time
</FormLabelComponent>
</FormNumberComponent>
}
<ContentDividerComponent/>
<FormTextComponent Label="Chart Color" Value="@ChartColor" OnChange="ChangeColor" />
<FormTextComponent Label="Chart Color" Value="@ChartColor" OnChange="ChangeColor"/>
</FormLayoutComponent>
@ -46,7 +46,7 @@
private string ChartColor => economyComparisonService.GetColor(ForPlayer);
private string Faction => economyComparisonService.GetFaction(ForPlayer);
private List<int> TownHallTimings => economyComparisonService.GetTownHallBuildTimes(ForPlayer);
protected override void OnInitialized()
{
base.OnInitialized();

190
IGP/Pages/HarassCalculatorPage.razor

@ -12,7 +12,7 @@
<PaperComponent>
Credit to Zard for deriving the formula.
</PaperComponent>
<PaperComponent>
<LayoutRowComponent>
<LayoutColumnComponent>
@ -41,29 +41,31 @@
</FormNumberComponent>
<FormNumberComponent Min="1"
Id="numberOfTownHallsExisting"
Id="numberOfTownHallsExisting"
Value="@((int)NumberOfTownHallsExisting)"
OnChange="OnTownHallsChanged">
<FormLabelComponent>Number of townhalls you have</FormLabelComponent>
</FormNumberComponent>
<div id="numberOfTownHallTravelTimes">
@{
var index = 0;
}
@foreach (var travelTime in TravelTimes) {
index++;
if (index == 1) {
continue;
@{
var index = 0;
}
@foreach (var travelTime in TravelTimes)
{
index++;
if (index == 1)
{
continue;
}
var id = $"numberOfTownHallsExisting_{index}";
<FormNumberComponent Min="0"
Id="@id"
Value="@((int)travelTime.Value)"
OnChange="e => { OnTownHallTravelTimeChanged(e, travelTime); }">
<FormLabelComponent>Worker travel time from other base @(travelTime.Index + 1)</FormLabelComponent>
</FormNumberComponent>
}
var id = $"numberOfTownHallsExisting_{index}";
<FormNumberComponent Min="0"
Id="@id"
Value="@((int)travelTime.Value)"
OnChange="e => { OnTownHallTravelTimeChanged(e, travelTime); }">
<FormLabelComponent>Worker travel time from other base @(travelTime.Index + 1)</FormLabelComponent>
</FormNumberComponent>
}
</div>
@ -71,7 +73,7 @@
<Display>
<div style="font-size: 1.5rem; font-weight: 800;">
<span id="totalAlloyHarassment">
@TotalAlloyHarassment
@TotalAlloyHarassment
</span>
</div>
</Display>
@ -90,7 +92,7 @@
<div>
(<b>Average travel time:</b> <span id="getAverageTravelTime">@GetAverageTravelTime()</span>)
</div>
</LayoutColumnComponent>
</LayoutRowComponent>
</PaperComponent>
@ -104,9 +106,12 @@
</InfoQuestionComponent>
<InfoAnswerComponent>
The Harass Calculator allows you to calculate damage done to an enemy alloy line. For example, if you
were to attack with Ichors, and kill 6 enemy workers, you can set the <b>Number of workers lost to
harass</b> to 6. This would determine a loss of <span id="exampleTotalAlloyLoss">@ExampleTotalAlloyLoss</span> alloy. Quite
the large number.
were to attack with Ichors, and kill 6 enemy workers, you can set the
<b>
Number of workers lost to
harass
</b> to 6. This would determine a loss of <span id="exampleTotalAlloyLoss">@ExampleTotalAlloyLoss</span> alloy. Quite
the large number.
</InfoAnswerComponent>
</InfoBodyComponent>
@ -115,21 +120,27 @@
What can I learn from this?
</InfoQuestionComponent>
<InfoAnswerComponent>
Well, let's assume you lost a full alloy line of workers, and have to take that
@ExampleTotalAlloyLoss alloy cost (<span id="exampleWorkerCost">@ExampleWorkerCost</span>
to rebuy the workers, and <span id="exampleMiningTimeCost">@ExampleMiningTimeCost</span> in lost mining
Well, let's assume you lost a full alloy line of workers, and have to take that
@ExampleTotalAlloyLoss alloy cost (<span id="exampleWorkerCost">@ExampleWorkerCost</span>
to rebuy the workers, and <span id="exampleMiningTimeCost">@ExampleMiningTimeCost</span> in lost mining
time.)
<br/><br/>
If you were to set the <b>Number of townhalls you have</b> to 2, the calculator will consider worker
transfer micro. Allowing you to cut the total cost by roughly
<span id="exampleTotalAlloyLossDifference">@ExampleTotalAlloyLossDifference</span> alloy. However, that number isn't
If you were to set the <b>Number of townhalls you have</b> to 2, the calculator will consider worker
transfer micro. Allowing you to cut the total cost by roughly
<span id="exampleTotalAlloyLossDifference">@ExampleTotalAlloyLossDifference</span> alloy. However, that number isn't
entirely accurate, you are also going to have to bump up the <b>Worker travel time to alloy</b> to account for the time it takes the transferred workers to arrive at the decimated alloy line.
<br/><br/>
Let's say it takes 10 seconds for workers to transfer from your second base. Let's enter that for the
second base travel time for the more accurate loss of <span
id="exampleTotalAlloyLossAccurate">@ExampleTotalAlloyLossAccurate</span> alloy
(saving you <span id="exampleTotalAlloyLossAccurateDifference">@ExampleTotalAlloyLossAccurateDifference</span> alloy.) <i>Which is
much better than not transferring workers!</i>
second base travel time for the more accurate loss of
<span
id="exampleTotalAlloyLossAccurate">
@ExampleTotalAlloyLossAccurate
</span> alloy
(saving you <span id="exampleTotalAlloyLossAccurateDifference">@ExampleTotalAlloyLossAccurateDifference</span> alloy.)
<i>
Which is
much better than not transferring workers!
</i>
</InfoAnswerComponent>
</InfoBodyComponent>
@ -213,30 +224,30 @@
@code {
// Example calcs
float ExampleTotalAlloyLoss => Calculate(
WorkerReplacementCost(6),
SimultaneousProductionFloor(1,6),
6,
WorkerReplacementCost(6),
SimultaneousProductionFloor(1, 6),
6,
new List<float> { 0 });
float ExampleWorkerCost => WorkerReplacementCost(6);
float ExampleMiningTimeCost => ExampleTotalAlloyLoss - ExampleWorkerCost;
float ExampleTotalAlloyLossDifference => ExampleTotalAlloyLoss - Calculate(
WorkerReplacementCost(6),
SimultaneousProductionFloor(2,6),
6,
WorkerReplacementCost(6),
SimultaneousProductionFloor(2, 6),
6,
new List<float> { 0, 0 });
float ExampleTotalAlloyLossAccurate => Calculate(
WorkerReplacementCost(6),
SimultaneousProductionFloor(2,6),
6,
WorkerReplacementCost(6),
SimultaneousProductionFloor(2, 6),
6,
new List<float> { 0, 10 });
float ExampleTotalAlloyLossAccurateDifference => ExampleTotalAlloyLoss - ExampleTotalAlloyLossAccurate;
float TotalAlloyHarassment = 0;
float TotalAlloyHarassment;
readonly float CostOfWorker = 50;
readonly float AlloyMinedPerSecondByWorker = 1;
@ -244,14 +255,17 @@
float NumberOfWorkersLostToHarass = 1;
float NumberOfTownHallsExisting = 1;
float GetAverageTravelTime() {
if (TravelTimes.Count == 0) {
float GetAverageTravelTime()
{
if (TravelTimes.Count == 0)
{
return 0;
}
float sum = 0;
foreach (var travelTime in TravelTimes) {
foreach (var travelTime in TravelTimes)
{
sum += travelTime.Value;
}
@ -259,62 +273,73 @@
}
float SimultaneousProductionFloor() {
if (NumberOfTownHallsExisting <= 0 || NumberOfWorkersLostToHarass <= 0) {
float SimultaneousProductionFloor()
{
if (NumberOfTownHallsExisting <= 0 || NumberOfWorkersLostToHarass <= 0)
{
return 0;
}
return NumberOfWorkersLostToHarass / Math.Min(NumberOfTownHallsExisting, NumberOfWorkersLostToHarass);
}
float SimultaneousProductionFloor(float existingTownHalls, float numberOfWorkersLost) {
if (existingTownHalls <= 0 || numberOfWorkersLost <= 0) {
float SimultaneousProductionFloor(float existingTownHalls, float numberOfWorkersLost)
{
if (existingTownHalls <= 0 || numberOfWorkersLost <= 0)
{
return 0;
}
return numberOfWorkersLost / Math.Min(existingTownHalls, numberOfWorkersLost);
}
float WorkerReplacementCost() {
float WorkerReplacementCost()
{
return CostOfWorker * NumberOfWorkersLostToHarass;
}
float WorkerReplacementCost(int numberOfWorkersLostToHarass) {
float WorkerReplacementCost(int numberOfWorkersLostToHarass)
{
return CostOfWorker * numberOfWorkersLostToHarass;
}
float DelayedMiningCost() {
float DelayedMiningCost()
{
return TotalAlloyHarassment - WorkerReplacementCost();
}
void Calculate() {
TotalAlloyHarassment = Calculate(WorkerReplacementCost(),
SimultaneousProductionFloor(),
NumberOfWorkersLostToHarass,
void Calculate()
{
TotalAlloyHarassment = Calculate(WorkerReplacementCost(),
SimultaneousProductionFloor(),
NumberOfWorkersLostToHarass,
TravelTimes.Select(x => x.Value).ToList(),
TimeToProduceWorker,
TimeToProduceWorker,
AlloyMinedPerSecondByWorker);
}
float Calculate(float workerReplacementCost,
float simultaneousProductionFloor,
float numberOfWorkersLostToHarass,
IList<float> travelTimes,
float timeToProduceWorker = 20,
float alloyMinedPerSecondByWorker = 1) {
float totalAlloyHarassment = workerReplacementCost;
for (var workerProductionIndex = 0; workerProductionIndex < simultaneousProductionFloor; workerProductionIndex++) {
float Calculate(float workerReplacementCost,
float simultaneousProductionFloor,
float numberOfWorkersLostToHarass,
IList<float> travelTimes,
float timeToProduceWorker = 20,
float alloyMinedPerSecondByWorker = 1)
{
var totalAlloyHarassment = workerReplacementCost;
for (var workerProductionIndex = 0; workerProductionIndex < simultaneousProductionFloor; workerProductionIndex++)
{
totalAlloyHarassment += alloyMinedPerSecondByWorker * timeToProduceWorker * (workerProductionIndex + 1);
}
var remainder = (int)(numberOfWorkersLostToHarass % simultaneousProductionFloor);
for (var remainderIndex = 0; remainderIndex < remainder; remainderIndex++) {
for (var remainderIndex = 0; remainderIndex < remainder; remainderIndex++)
{
totalAlloyHarassment += alloyMinedPerSecondByWorker * timeToProduceWorker * (simultaneousProductionFloor + 1);
}
for (var travelTimeIndex = 0; travelTimeIndex < numberOfWorkersLostToHarass; travelTimeIndex++) {
for (var travelTimeIndex = 0; travelTimeIndex < numberOfWorkersLostToHarass; travelTimeIndex++)
{
var townHallIndex = travelTimeIndex % travelTimes.Count;
totalAlloyHarassment += alloyMinedPerSecondByWorker * travelTimes[townHallIndex];
}
@ -322,7 +347,8 @@
return totalAlloyHarassment;
}
protected override void OnInitialized() {
protected override void OnInitialized()
{
base.OnInitialized();
Calculate();
}
@ -330,18 +356,20 @@
public List<TravelTime> TravelTimes { get; set; } = new() { new TravelTime(0, 0) };
private void OnTownHallsChanged(ChangeEventArgs obj) {
private void OnTownHallsChanged(ChangeEventArgs obj)
{
NumberOfTownHallsExisting = int.Parse(obj.Value!.ToString()!);
while (TravelTimes.Count > NumberOfTownHallsExisting)
TravelTimes.Remove(TravelTimes.Last());
while (TravelTimes.Count < NumberOfTownHallsExisting)
TravelTimes.Add(new TravelTime(TravelTimes.Count, 10 * (TravelTimes.Count)));
TravelTimes.Add(new TravelTime(TravelTimes.Count, 10 * TravelTimes.Count));
Calculate();
}
private void OnTownHallTravelTimeChanged(ChangeEventArgs obj, TravelTime travelTime) {
private void OnTownHallTravelTimeChanged(ChangeEventArgs obj, TravelTime travelTime)
{
travelTime.Value = (int)obj.Value!;
Calculate();

2
IGP/Pages/Notes/NotesIndexPage.razor

@ -17,7 +17,7 @@
else
{
<LayoutMediumContentComponent>
<WebsiteTitleComponent>Notes</WebsiteTitleComponent>
<PaperComponent>

2
IGP/Pages/Notes/NotesPage.razor

@ -16,8 +16,6 @@
}
else
{
<LayoutWithSidebarComponent>
<Sidebar>
<NoteNavComponent

9
IGP/Pages/PermissionsPage.razor

@ -47,10 +47,11 @@
<InfoBodyComponent>
<InfoQuestionComponent>What data does this website collect?</InfoQuestionComponent>
<InfoAnswerComponent>This website usages Google Analytics to collect data on usage of this website.
<InfoAnswerComponent>
This website usages Google Analytics to collect data on usage of this website.
<br/><br/>
Items include: if people use keyboard or mouse in build calculator, what pages people visit, and other usages.
</InfoAnswerComponent>
</InfoAnswerComponent>
</InfoBodyComponent>
<InfoBodyComponent>
@ -62,8 +63,8 @@
@code {
private bool _storageEnabled = false;
private bool _dataCollectionEnabled = false;
private bool _storageEnabled;
private bool _dataCollectionEnabled;
protected override void OnInitialized()
{

24
IGP/Pages/StoragePage.razor

@ -28,14 +28,14 @@
<DevOnlyComponent>
<FormLayoutComponent>
<FormToggleComponent
Label="Is Dynamic Formatting"
Info="Should [Attacks Per Second/Seconds Between Attack] match in-game values?"
Value="@_isDynamicFormatting"
OnChange="DynamicFormattingChanged"/>
</FormLayoutComponent>
<FormToggleComponent
Label="Is Dynamic Formatting"
Info="Should [Attacks Per Second/Seconds Between Attack] match in-game values?"
Value="@_isDynamicFormatting"
OnChange="DynamicFormattingChanged"/>
</FormLayoutComponent>
</DevOnlyComponent>
</PaperComponent>
<PaperComponent>
@ -148,7 +148,7 @@
protected override void OnInitialized()
{
base.OnInitialized();
_enabledPermissions = StorageService.GetValue<bool>(StorageKeys.EnabledStorage);
RefreshDefaults();
@ -161,11 +161,11 @@
StorageService.Unsubscribe(RefreshDefaults);
}
private int? _attackTime = null;
private int? _travelTime = null;
private int? _attackTime;
private int? _travelTime;
private string? _faction = null;
private string? _immortal = null;
private string? _faction;
private string? _immortal;
private string? Faction => _faction == null ? DataType.FACTION_QRath : _faction;
private string? Immortal => _immortal == null ? DataType.IMMORTAL_Orzum : _immortal;

22
IGP/Pages/StreamsPage.razor

@ -14,21 +14,25 @@
</InfoBodyComponent>
<InfoBodyComponent>
<InfoQuestionComponent>What exactly are you streaming?</InfoQuestionComponent>
<InfoAnswerComponent>The plan will be sprint planning and general development of this website.
<InfoAnswerComponent>
The plan will be sprint planning and general development of this website.
<br/><br/>
Feel free to jump into the stream to ask questions or make feature requests for the website.</InfoAnswerComponent>
Feel free to jump into the stream to ask questions or make feature requests for the website.
</InfoAnswerComponent>
</InfoBodyComponent>
<InfoBodyComponent>
<InfoQuestionComponent>Why should you watch these streams?</InfoQuestionComponent>
<InfoAnswerComponent>You shouldn't. By nature of being live coding streams, I think they will have little entertainment and educational value.
<InfoAnswerComponent>
You shouldn't. By nature of being live coding streams, I think they will have little entertainment and educational value.
<br/><br/>
The most reason (that comes to mind) is to see a coding day of one software developer. Although please note that I stream content that I think is easy (to look smart), so it's not a "truly random" coding day. For example, you won't find any vods of the five-week sprint where I (figuratively) bash my head against the table trying to get SQL working in Blazor WASM before giving up and moving on. </InfoAnswerComponent>
The most reason (that comes to mind) is to see a coding day of one software developer. Although please note that I stream content that I think is easy (to look smart), so it's not a "truly random" coding day. For example, you won't find any vods of the five-week sprint where I (figuratively) bash my head against the table trying to get SQL working in Blazor WASM before giving up and moving on.
</InfoAnswerComponent>
</InfoBodyComponent>
<InfoBodyComponent>
<InfoQuestionComponent>Anything else I should know?</InfoQuestionComponent>
<InfoAnswerComponent>I'll be streaming under the "<a href="https://www.twitch.tv/directory/game/Software%20and%20Game%20Development" target="_blank">Twitch, Software and Game Development</a>" category. If you are looking to see some actual IGP gameplay, there are better and more focused streamers to provide said content. Check out the "<a href="https://www.twitch.tv/directory/game/IMMORTAL%3A%20Gates%20of%20Pyre/videos/all" target="_blank">Twitch, IMMORTAL: Gates of Pyre</a>" category for some examples.</InfoAnswerComponent>
</InfoBodyComponent>
<InfoQuestionComponent>Anything else I should know?</InfoQuestionComponent>
<InfoAnswerComponent>I'll be streaming under the "<a href="https://www.twitch.tv/directory/game/Software%20and%20Game%20Development" target="_blank">Twitch, Software and Game Development</a>" category. If you are looking to see some actual IGP gameplay, there are better and more focused streamers to provide said content. Check out the "<a href="https://www.twitch.tv/directory/game/IMMORTAL%3A%20Gates%20of%20Pyre/videos/all" target="_blank">Twitch, IMMORTAL: Gates of Pyre</a>" category for some examples.</InfoAnswerComponent>
</InfoBodyComponent>
</PaperComponent>
</LayoutMediumContentComponent>

1
IGP/Portals/SearchPortal.razor

@ -18,7 +18,6 @@
await searchService.Load();
await jsRuntime.InvokeVoidAsync("SetDotnetReference", DotNetObjectReference.Create(this));
}
public void Dispose()

2
Model/BuildOrders/BuildOrderModel.cs

@ -28,7 +28,7 @@ public class BuildOrderModel
public Dictionary<string, int> UniqueCompletedTimes { get; set; } = new();
public Dictionary<string, int> UniqueCompletedCount { get; set; } = new();
public Dictionary<int, int> SupplyCountTimes { get; set; } = new();
public Dictionary<string, List<EntityModel>> UniqueCompleted { get; set; } = new();
public List<TrainingCapacityUsedModel> TrainingCapacityUsed { get; set; } = new();

2
Model/Chart/PointModel.cs

@ -11,7 +11,7 @@ public class PointModel
var display = Interval / highestInterval * displayScale;
return ((int)display).ToString();
}
public string GetValue(float highestValue, float displayScale)
{

241
Model/Entity/Data/DATA.cs

@ -60,12 +60,11 @@ public class DATA
Notes = @"Doesn't take up a scout slot."
})
.AddPart(new EntityRequirementModel { Id = DataType.TEAPOT_Teapot })
.AddPart(new EntitySupplyModel{Takes = 1})
.AddPart(new EntitySupplyModel { Takes = 1 })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 50 })
.AddPart(new EntityVitalityModel { Health = 100, DefenseLayer = 30, Armor = ArmorType.Light })
.AddPart(new EntityMovementModel { Speed = 280, Movement = MovementType.Air })
.AddPart(new EntityIdPassiveModel{ Id = DataType.PASSIVE_Detection})
.AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_Detection })
},
// Families
@ -448,7 +447,8 @@ public class DATA
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityVanguardAddedModel
{ ReplaceId = DataType.UNIT_Sipari, ImmortalId = DataType.IMMORTAL_Orzum })
.AddPart(new EntityProductionModel { Alloy = 100, BuildTime = 24, ProducedBy = DataType.BUILDING_LegionHall})
.AddPart(new EntityProductionModel
{ Alloy = 100, BuildTime = 24, ProducedBy = DataType.BUILDING_LegionHall })
.AddPart(new EntitySupplyModel { Takes = 4 })
.AddPart(new EntityVitalityModel { Health = 180, DefenseLayer = 100, Armor = ArmorType.Light })
.AddPart(new EntityWeaponModel
@ -477,7 +477,8 @@ public class DATA
.AddPart(new EntityTierModel { Tier = 3 })
.AddPart(new EntityHotkeyModel { Hotkey = "R", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 200, Ether = 125, BuildTime = 40, ProducedBy = DataType.BUILDING_Angelarium })
.AddPart(new EntityProductionModel
{ Alloy = 200, Ether = 125, BuildTime = 40, ProducedBy = DataType.BUILDING_Angelarium })
.AddPart(new EntityVitalityModel { Health = 350, DefenseLayer = 120, Armor = ArmorType.Heavy })
.AddPart(new EntitySupplyModel { Takes = 6 })
.AddPart(new EntityWeaponModel
@ -516,7 +517,8 @@ public class DATA
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityVanguardAddedModel
{ ReplaceId = DataType.UNIT_Magi, ImmortalId = DataType.IMMORTAL_Ajari })
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 75, BuildTime = 35, ProducedBy = DataType.BUILDING_LegionHall })
.AddPart(new EntityProductionModel
{ Alloy = 75, Ether = 75, BuildTime = 35, ProducedBy = DataType.BUILDING_LegionHall })
.AddPart(new EntitySupplyModel { Takes = 4 })
.AddPart(new EntityVitalityModel
{ Health = 140, DefenseLayer = 100, Armor = ArmorType.Light, IsEtheric = true })
@ -550,7 +552,8 @@ public class DATA
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityVanguardAddedModel
{ ReplaceId = DataType.UNIT_Hallower, ImmortalId = DataType.IMMORTAL_Ajari })
.AddPart(new EntityProductionModel { Alloy = 150, Ether = 100, BuildTime = 40, ProducedBy = DataType.BUILDING_SoulFoundry })
.AddPart(new EntityProductionModel
{ Alloy = 150, Ether = 100, BuildTime = 40, ProducedBy = DataType.BUILDING_SoulFoundry })
.AddPart(new EntitySupplyModel { Takes = 5 })
.AddPart(new EntityVitalityModel
{ Energy = 100, Health = 100, DefenseLayer = 100, Armor = ArmorType.Medium, IsEtheric = true })
@ -586,7 +589,8 @@ public class DATA
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
.AddPart(new EntityVanguardAddedModel
{ ReplaceId = DataType.UNIT_Underspine, ImmortalId = DataType.IMMORTAL_Mala })
.AddPart(new EntityProductionModel { Alloy = 175, Ether = 50, BuildTime = 35, ProducedBy = DataType.BUILDING_AmberWomb })
.AddPart(new EntityProductionModel
{ Alloy = 175, Ether = 50, BuildTime = 35, ProducedBy = DataType.BUILDING_AmberWomb })
.AddPart(new EntitySupplyModel { Takes = 5 })
.AddPart(new EntityVitalityModel
{ Health = 160, DefenseLayer = 40, Armor = ArmorType.Medium, IsEtheric = false })
@ -615,7 +619,8 @@ public class DATA
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
.AddPart(new EntityVanguardAddedModel
{ ReplaceId = DataType.UNIT_RedSeer, ImmortalId = DataType.IMMORTAL_Mala })
.AddPart(new EntityProductionModel { Alloy = 60, Ether = 150, BuildTime = 45, ProducedBy = DataType.BUILDING_AltarOfTheWorthy })
.AddPart(new EntityProductionModel
{ Alloy = 60, Ether = 150, BuildTime = 45, ProducedBy = DataType.BUILDING_AltarOfTheWorthy })
.AddPart(new EntitySupplyModel { Takes = 4 })
.AddPart(new EntityVitalityModel
{
@ -645,7 +650,8 @@ public class DATA
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
.AddPart(new EntityVanguardAddedModel
{ ReplaceId = DataType.UNIT_MaskedHunter, ImmortalId = DataType.IMMORTAL_Xol })
.AddPart(new EntityProductionModel { Alloy = 50, Ether = 0, BuildTime = 20, ProducedBy = DataType.BUILDING_AltarOfTheWorthy })
.AddPart(new EntityProductionModel
{ Alloy = 50, Ether = 0, BuildTime = 20, ProducedBy = DataType.BUILDING_AltarOfTheWorthy })
.AddPart(new EntitySupplyModel { Takes = 2 })
.AddPart(new EntityVitalityModel
{ Health = 85, DefenseLayer = 10, Armor = ArmorType.Light, IsEtheric = false })
@ -674,7 +680,8 @@ public class DATA
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
.AddPart(new EntityVanguardAddedModel
{ ReplaceId = DataType.UNIT_Bloodbound, ImmortalId = DataType.IMMORTAL_Xol })
.AddPart(new EntityProductionModel { Alloy = 80, Ether = 80, BuildTime = 35, ProducedBy = DataType.BUILDING_AltarOfTheWorthy })
.AddPart(new EntityProductionModel
{ Alloy = 80, Ether = 80, BuildTime = 35, ProducedBy = DataType.BUILDING_AltarOfTheWorthy })
.AddPart(new EntitySupplyModel { Takes = 4 })
.AddPart(new EntityVitalityModel
{
@ -689,7 +696,6 @@ public class DATA
})
.AddPart(new EntityIdAbilityModel { Id = DataType.ABILITY_LethalBond })
.AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_CastingFromBlood })
},
// Units
// Q'Rath
@ -719,7 +725,8 @@ public class DATA
.AddPart(new EntityVanguardReplacedModel
{ ImmortalId = DataType.IMMORTAL_Orzum, ReplacedById = DataType.VANGUARD_Zentari_Orzum })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 75, BuildTime = 25, ProducedBy = DataType.BUILDING_LegionHall })
.AddPart(new EntityProductionModel
{ Alloy = 75, BuildTime = 25, ProducedBy = DataType.BUILDING_LegionHall })
.AddPart(new EntitySupplyModel { Takes = 3 })
.AddPart(new EntityVitalityModel { Health = 140, DefenseLayer = 70, Armor = ArmorType.Light })
.AddPart(new EntityRequirementModel
@ -750,7 +757,8 @@ public class DATA
.AddPart(new EntityTierModel { Tier = 1.5f })
.AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 75, BuildTime = 35, ProducedBy = DataType.BUILDING_LegionHall })
.AddPart(new EntityProductionModel
{ Alloy = 75, Ether = 75, BuildTime = 35, ProducedBy = DataType.BUILDING_LegionHall })
.AddPart(new EntitySupplyModel { Takes = 3 })
.AddPart(new EntityVanguardReplacedModel
{ ImmortalId = DataType.IMMORTAL_Ajari, ReplacedById = DataType.VANGUARD_Saoshin_Ajari })
@ -788,7 +796,8 @@ public class DATA
.AddPart(new EntityTierModel { Tier = 1.5f })
.AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 40, BuildTime = 30, ProducedBy = DataType.BUILDING_SoulFoundry })
.AddPart(new EntityProductionModel
{ Alloy = 100, Ether = 40, BuildTime = 30, ProducedBy = DataType.BUILDING_SoulFoundry })
.AddPart(new EntitySupplyModel { Takes = 4 })
.AddPart(new EntityRequirementModel
{
@ -823,7 +832,8 @@ public class DATA
.AddPart(new EntityTierModel { Tier = 2 })
.AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 125, Ether = 10, BuildTime = 35, ProducedBy = DataType.BUILDING_SoulFoundry })
.AddPart(new EntityProductionModel
{ Alloy = 125, Ether = 10, BuildTime = 35, ProducedBy = DataType.BUILDING_SoulFoundry })
.AddPart(new EntitySupplyModel { Takes = 4 })
.AddPart(new EntityVitalityModel { Health = 120, DefenseLayer = 100, Armor = ArmorType.Medium })
.AddPart(new EntityRequirementModel
@ -855,7 +865,8 @@ public class DATA
.AddPart(new EntityTierModel { Tier = 2 })
.AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 150, Ether = 75, BuildTime = 35, ProducedBy = DataType.BUILDING_SoulFoundry })
.AddPart(new EntityProductionModel
{ Alloy = 150, Ether = 75, BuildTime = 35, ProducedBy = DataType.BUILDING_SoulFoundry })
.AddPart(new EntitySupplyModel { Takes = 5 })
.AddPart(new EntityVitalityModel { Health = 175, DefenseLayer = 150, Armor = ArmorType.Medium })
.AddPart(new EntityRequirementModel
@ -890,7 +901,8 @@ public class DATA
.AddPart(new EntityTierModel { Tier = 2 })
.AddPart(new EntityHotkeyModel { Hotkey = "W", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 190, Ether = 75, BuildTime = 35, ProducedBy = DataType.BUILDING_SoulFoundry })
.AddPart(new EntityProductionModel
{ Alloy = 190, Ether = 75, BuildTime = 35, ProducedBy = DataType.BUILDING_SoulFoundry })
.AddPart(new EntitySupplyModel { Takes = 5 })
.AddPart(new EntityVitalityModel { Health = 200, DefenseLayer = 100, Armor = ArmorType.Heavy })
.AddPart(new EntityMovementModel { Speed = 340, Movement = MovementType.Ground })
@ -924,7 +936,8 @@ public class DATA
.AddPart(new EntityVanguardReplacedModel
{ ImmortalId = DataType.IMMORTAL_Ajari, ReplacedById = DataType.VANGUARD_ArkMother_Ajari })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 150, Ether = 75, BuildTime = 35, ProducedBy = DataType.BUILDING_SoulFoundry })
.AddPart(new EntityProductionModel
{ Alloy = 150, Ether = 75, BuildTime = 35, ProducedBy = DataType.BUILDING_SoulFoundry })
.AddPart(new EntitySupplyModel { Takes = 5 })
.AddPart(new EntityRequirementModel
{
@ -956,7 +969,8 @@ public class DATA
.AddPart(new EntityTierModel { Tier = 3 })
.AddPart(new EntityHotkeyModel { Hotkey = "E", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 150, Ether = 75, BuildTime = 35, ProducedBy = DataType.BUILDING_Angelarium })
.AddPart(new EntityProductionModel
{ Alloy = 150, Ether = 75, BuildTime = 35, ProducedBy = DataType.BUILDING_Angelarium })
.AddPart(new EntitySupplyModel { Takes = 5 })
.AddPart(new EntityVitalityModel { Health = 150, DefenseLayer = 100, Armor = ArmorType.Medium })
.AddPart(new EntityMovementModel { Speed = 525, Movement = MovementType.Air })
@ -982,7 +996,8 @@ public class DATA
.AddPart(new EntityTierModel { Tier = 3 })
.AddPart(new EntityHotkeyModel { Hotkey = "A", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 250, Ether = 100, BuildTime = 50, ProducedBy = DataType.BUILDING_Angelarium })
.AddPart(new EntityProductionModel
{ Alloy = 250, Ether = 100, BuildTime = 50, ProducedBy = DataType.BUILDING_Angelarium })
.AddPart(new EntitySupplyModel { Takes = 9 })
.AddPart(new EntityVitalityModel { Health = 350, DefenseLayer = 200, Armor = ArmorType.Heavy })
.AddPart(new EntityRequirementModel
@ -1020,7 +1035,8 @@ public class DATA
.AddPart(new EntityVanguardReplacedModel
{ ImmortalId = DataType.IMMORTAL_Orzum, ReplacedById = DataType.VANGUARD_Sceptre_Orzum })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 175, Ether = 100, BuildTime = 40, ProducedBy = DataType.BUILDING_Angelarium })
.AddPart(new EntityProductionModel
{ Alloy = 175, Ether = 100, BuildTime = 40, ProducedBy = DataType.BUILDING_Angelarium })
.AddPart(new EntitySupplyModel { Takes = 6 })
.AddPart(new EntityRequirementModel
{
@ -1042,7 +1058,8 @@ public class DATA
.AddPart(new EntityTierModel { Tier = 3.5f })
.AddPart(new EntityHotkeyModel { Hotkey = "F", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 110, Ether = 250, BuildTime = 55, ProducedBy = DataType.BUILDING_Angelarium })
.AddPart(new EntityProductionModel
{ Alloy = 110, Ether = 250, BuildTime = 55, ProducedBy = DataType.BUILDING_Angelarium })
.AddPart(new EntitySupplyModel { Takes = 6 })
.AddPart(new EntityRequirementModel
{
@ -1102,7 +1119,8 @@ public class DATA
Requirement = RequirementType.Production_Building
})
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
.AddPart(new EntityProductionModel { Alloy = 50, BuildTime = 20, ProducedBy = DataType.BUILDING_AltarOfTheWorthy })
.AddPart(new EntityProductionModel
{ Alloy = 50, BuildTime = 20, ProducedBy = DataType.BUILDING_AltarOfTheWorthy })
.AddPart(new EntitySupplyModel { Takes = 2 })
.AddPart(new EntityVitalityModel
{ Health = 85, DefenseLayer = 25, Defense = DefenseType.Overgrowth, Armor = ArmorType.Light })
@ -1130,7 +1148,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 30, BuildTime = 25, ProducedBy = DataType.BUILDING_AltarOfTheWorthy })
.AddPart(new EntityProductionModel
{ Alloy = 75, Ether = 30, BuildTime = 25, ProducedBy = DataType.BUILDING_AltarOfTheWorthy })
.AddPart(new EntitySupplyModel { Takes = 3 })
.AddPart(new EntityVitalityModel { Health = 160, DefenseLayer = 70, Armor = ArmorType.Heavy })
.AddPart(new EntityMovementModel { Speed = 378, Movement = MovementType.Ground })
@ -1161,7 +1180,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
.AddPart(new EntityProductionModel { Alloy = 80, Ether = 80, BuildTime = 30, ProducedBy = DataType.BUILDING_AltarOfTheWorthy })
.AddPart(new EntityProductionModel
{ Alloy = 80, Ether = 80, BuildTime = 30, ProducedBy = DataType.BUILDING_AltarOfTheWorthy })
.AddPart(new EntitySupplyModel { Takes = 4 })
.AddPart(new EntityVitalityModel
{ Energy = 60, Health = 100, DefenseLayer = 40, Armor = ArmorType.Light })
@ -1174,7 +1194,6 @@ public class DATA
.AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_QuenchingScythes })
.AddPart(new EntityIdPassiveModel { Id = DataType.ABILITY_CullingStrike })
.AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_CastingFromBlood })
},
{
DataType.UNIT_RedSeer,
@ -1195,7 +1214,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "F", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
.AddPart(new EntityProductionModel { Alloy = 40, Ether = 140, BuildTime = 40, ProducedBy = DataType.BUILDING_AltarOfTheWorthy })
.AddPart(new EntityProductionModel
{ Alloy = 40, Ether = 140, BuildTime = 40, ProducedBy = DataType.BUILDING_AltarOfTheWorthy })
.AddPart(new EntitySupplyModel { Takes = 3 })
.AddPart(new EntityVitalityModel
{
@ -1233,7 +1253,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "Q", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
.AddPart(new EntityProductionModel { Alloy = 70, Ether = 50, BuildTime = 25, ProducedBy = DataType.BUILDING_AltarOfTheWorthy })
.AddPart(new EntityProductionModel
{ Alloy = 70, Ether = 50, BuildTime = 25, ProducedBy = DataType.BUILDING_AltarOfTheWorthy })
.AddPart(new EntitySupplyModel { Takes = 3 })
.AddPart(new EntityVitalityModel { Health = 140, DefenseLayer = 40, Armor = ArmorType.Medium })
.AddPart(new EntityMovementModel { Speed = 350, Movement = MovementType.Ground })
@ -1263,7 +1284,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
.AddPart(new EntityProductionModel { Alloy = 95, Ether = 20, BuildTime = 30, ProducedBy = DataType.BUILDING_AmberWomb })
.AddPart(new EntityProductionModel
{ Alloy = 95, Ether = 20, BuildTime = 30, ProducedBy = DataType.BUILDING_AmberWomb })
.AddPart(new EntitySupplyModel { Takes = 4 })
.AddPart(new EntityVitalityModel { Health = 100, DefenseLayer = 40, Armor = ArmorType.Medium })
.AddPart(new EntityMovementModel { Speed = 382, Movement = MovementType.Ground })
@ -1293,7 +1315,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
.AddPart(new EntityProductionModel { Alloy = 150, Ether = 80, BuildTime = 40, ProducedBy = DataType.BUILDING_AmberWomb })
.AddPart(new EntityProductionModel
{ Alloy = 150, Ether = 80, BuildTime = 40, ProducedBy = DataType.BUILDING_AmberWomb })
.AddPart(new EntitySupplyModel { Takes = 5 })
.AddPart(new EntityVitalityModel { Health = 175, DefenseLayer = 60, Armor = ArmorType.Heavy })
.AddPart(new EntityMovementModel { Speed = 350, Movement = MovementType.Ground })
@ -1328,7 +1351,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "E", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
.AddPart(new EntityProductionModel { Alloy = 40, Ether = 40, BuildTime = 30, ProducedBy = DataType.BUILDING_BoneCanopy })
.AddPart(new EntityProductionModel
{ Alloy = 40, Ether = 40, BuildTime = 30, ProducedBy = DataType.BUILDING_BoneCanopy })
.AddPart(new EntitySupplyModel { Takes = 2 })
.AddPart(new EntityVitalityModel { Health = 35, DefenseLayer = 10, Armor = ArmorType.Light })
.AddPart(new EntityMovementModel { Speed = 532, Movement = MovementType.Air })
@ -1353,7 +1377,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "R", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
.AddPart(new EntityProductionModel { Alloy = 80, Ether = 50, BuildTime = 30, ProducedBy = DataType.BUILDING_BoneCanopy })
.AddPart(new EntityProductionModel
{ Alloy = 80, Ether = 50, BuildTime = 30, ProducedBy = DataType.BUILDING_BoneCanopy })
.AddPart(new EntitySupplyModel { Takes = 3 })
.AddPart(new EntityVitalityModel { Health = 120, DefenseLayer = 40, Armor = ArmorType.Light })
.AddPart(new EntityMovementModel { Speed = 525, Movement = MovementType.Air })
@ -1375,7 +1400,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "W", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
.AddPart(new EntityProductionModel { Alloy = 80, Ether = 30, BuildTime = 30, ProducedBy = DataType.BUILDING_AmberWomb })
.AddPart(new EntityProductionModel
{ Alloy = 80, Ether = 30, BuildTime = 30, ProducedBy = DataType.BUILDING_AmberWomb })
.AddPart(new EntitySupplyModel { Takes = 3 })
.AddPart(new EntityVitalityModel { Health = 120, DefenseLayer = 45, Armor = ArmorType.Medium })
.AddPart(new EntityMovementModel { Speed = 350, Movement = MovementType.Ground })
@ -1403,7 +1429,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "A", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
.AddPart(new EntityProductionModel { Alloy = 190, Ether = 150, BuildTime = 50, ProducedBy = DataType.BUILDING_BoneCanopy })
.AddPart(new EntityProductionModel
{ Alloy = 190, Ether = 150, BuildTime = 50, ProducedBy = DataType.BUILDING_BoneCanopy })
.AddPart(new EntitySupplyModel { Takes = 8 })
.AddPart(new EntityVitalityModel { Health = 350, DefenseLayer = 100, Armor = ArmorType.Heavy })
.AddPart(new EntityMovementModel { Speed = 210, Movement = MovementType.Air })
@ -1438,7 +1465,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "TAB" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 100, BuildTime = 100, ProducedBy = DataType.BUILDING_Reliquary })
.AddPart(new EntityProductionModel
{ Alloy = 100, Ether = 100, BuildTime = 100, ProducedBy = DataType.BUILDING_Reliquary })
.AddPart(new EntityRequirementModel
{
Id = DataType.BUILDING_Reliquary,
@ -1457,7 +1485,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "R", HoldSpace = true, HotkeyGroup = "TAB" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 80, Ether = 80, BuildTime = 34, ProducedBy = DataType.BUILDING_HouseOfFadingSaints })
.AddPart(new EntityProductionModel
{ Alloy = 80, Ether = 80, BuildTime = 34, ProducedBy = DataType.BUILDING_HouseOfFadingSaints })
.AddPart(new EntityRequirementModel
{
Id = DataType.BUILDING_HouseOfFadingSaints,
@ -1475,7 +1504,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "TAB", HoldSpace = true })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 100, BuildTime = 43, ProducedBy = DataType.BUILDING_EyeOfAros })
.AddPart(new EntityProductionModel
{ Alloy = 100, Ether = 100, BuildTime = 43, ProducedBy = DataType.BUILDING_EyeOfAros })
.AddPart(new EntityRequirementModel
{
Id = DataType.BUILDING_EyeOfAros,
@ -1495,7 +1525,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "TAB" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 50, Ether = 100, BuildTime = 60, ProducedBy = DataType.BUILDING_Reliquary })
.AddPart(new EntityProductionModel
{ Alloy = 50, Ether = 100, BuildTime = 60, ProducedBy = DataType.BUILDING_Reliquary })
.AddPart(new EntityRequirementModel
{ Id = DataType.BUILDING_Reliquary, Requirement = RequirementType.Research_Building })
.AddPart(new EntityVanguardAddedModel
@ -1511,7 +1542,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "TAB", HoldSpace = true })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 75, BuildTime = 29, ProducedBy = DataType.BUILDING_HouseOfFadingSaints })
.AddPart(new EntityProductionModel
{ Alloy = 75, Ether = 75, BuildTime = 29, ProducedBy = DataType.BUILDING_HouseOfFadingSaints })
.AddPart(new EntityRequirementModel
{
Id = DataType.BUILDING_HouseOfFadingSaints,
@ -1525,7 +1557,8 @@ public class DATA
{ Name = "Windstep", Descriptive = DescriptiveType.Upgrade, Description = "Unlocks windstep." })
.AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "TAB" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 50, Ether = 75, BuildTime = 55, ProducedBy = DataType.BUILDING_Reliquary })
.AddPart(new EntityProductionModel
{ Alloy = 50, Ether = 75, BuildTime = 55, ProducedBy = DataType.BUILDING_Reliquary })
.AddPart(new EntityRequirementModel
{ Id = DataType.BUILDING_Reliquary, Requirement = RequirementType.Production_Building })
},
@ -1539,7 +1572,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "TAB" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 150, Ether = 100, BuildTime = 43, ProducedBy = DataType.BUILDING_Reliquary })
.AddPart(new EntityProductionModel
{ Alloy = 150, Ether = 100, BuildTime = 43, ProducedBy = DataType.BUILDING_Reliquary })
.AddPart(new EntityRequirementModel
{ Id = DataType.BUILDING_Reliquary, Requirement = RequirementType.Research_Building })
.AddPart(new EntityIdUpgradeModel { Id = DataType.UPGRADE_WindStep })
@ -1555,7 +1589,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "TAB" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 100, BuildTime = 60, ProducedBy = DataType.BUILDING_HouseOfFadingSaints })
.AddPart(new EntityProductionModel
{ Alloy = 75, Ether = 100, BuildTime = 60, ProducedBy = DataType.BUILDING_HouseOfFadingSaints })
.AddPart(new EntityRequirementModel
{
Id = DataType.BUILDING_HouseOfFadingSaints,
@ -1572,7 +1607,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "Q", HoldSpace = true, HotkeyGroup = "TAB" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 100, BuildTime = 43, ProducedBy = DataType.BUILDING_EyeOfAros })
.AddPart(new EntityProductionModel
{ Alloy = 100, Ether = 100, BuildTime = 43, ProducedBy = DataType.BUILDING_EyeOfAros })
.AddPart(new EntityRequirementModel
{
Id = DataType.BUILDING_EyeOfAros,
@ -1591,7 +1627,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "A", HoldSpace = true, HotkeyGroup = "TAB" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 75, BuildTime = 45, ProducedBy = DataType.BUILDING_BearerOfTheCrown })
.AddPart(new EntityProductionModel
{ Alloy = 100, Ether = 75, BuildTime = 45, ProducedBy = DataType.BUILDING_BearerOfTheCrown })
.AddPart(new EntityRequirementModel
{
Id = DataType.BUILDING_BearerOfTheCrown, Requirement = RequirementType.Production_Building
@ -1607,7 +1644,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "R", HoldSpace = true, HotkeyGroup = "TAB" })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityProductionModel { Alloy = 150, Ether = 100, BuildTime = 30, ProducedBy = DataType.BUILDING_EyeOfAros })
.AddPart(new EntityProductionModel
{ Alloy = 150, Ether = 100, BuildTime = 30, ProducedBy = DataType.BUILDING_EyeOfAros })
.AddPart(new EntityRequirementModel
{
Id = DataType.BUILDING_EyeOfAros, Requirement = RequirementType.Production_Building
@ -1638,7 +1676,8 @@ public class DATA
Id = DataType.BUILDING_Neurocyte,
Requirement = RequirementType.Production_Building
})
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 80, BuildTime = 60, ProducedBy = DataType.BUILDING_Neurocyte })
.AddPart(new EntityProductionModel
{ Alloy = 100, Ether = 80, BuildTime = 60, ProducedBy = DataType.BUILDING_Neurocyte })
},
{
DataType.UPGRADE_BloodMothersFevor,
@ -1659,7 +1698,8 @@ public class DATA
Id = DataType.BUILDING_AltarOfTheWorthy,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 150, BuildTime = 80, ProducedBy = DataType.BUILDING_RedVale })
.AddPart(new EntityProductionModel
{ Alloy = 100, Ether = 150, BuildTime = 80, ProducedBy = DataType.BUILDING_RedVale })
},
{
DataType.UPGRADE_DenInstinct,
@ -1672,7 +1712,8 @@ public class DATA
Id = DataType.BUILDING_Neurocyte,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 120, BuildTime = 45, ProducedBy = DataType.BUILDING_Neurocyte })
.AddPart(new EntityProductionModel
{ Alloy = 100, Ether = 120, BuildTime = 45, ProducedBy = DataType.BUILDING_Neurocyte })
},
{
DataType.UPGRADE_PursuitLigaments,
@ -1685,7 +1726,8 @@ public class DATA
Id = DataType.BUILDING_Neurocyte,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 100, BuildTime = 45, ProducedBy = DataType.BUILDING_Neurocyte })
.AddPart(new EntityProductionModel
{ Alloy = 75, Ether = 100, BuildTime = 45, ProducedBy = DataType.BUILDING_Neurocyte })
},
{
DataType.UPGRADE_ResinantDeploy,
@ -1703,7 +1745,8 @@ public class DATA
Id = DataType.BUILDING_AmberWomb,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityProductionModel { Alloy = 50, Ether = 100, BuildTime = 43, ProducedBy = DataType.BUILDING_Neurocyte })
.AddPart(new EntityProductionModel
{ Alloy = 50, Ether = 100, BuildTime = 43, ProducedBy = DataType.BUILDING_Neurocyte })
},
{
DataType.UPGRADE_XacalDamage,
@ -1716,7 +1759,8 @@ public class DATA
Id = DataType.BUILDING_Neurocyte,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 75, BuildTime = 60, ProducedBy = DataType.BUILDING_Neurocyte })
.AddPart(new EntityProductionModel
{ Alloy = 100, Ether = 75, BuildTime = 60, ProducedBy = DataType.BUILDING_Neurocyte })
},
{
DataType.UPGRADE_BehemothCapacity,
@ -1729,7 +1773,8 @@ public class DATA
Id = DataType.BUILDING_DeepNest,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityProductionModel { Alloy = 150, Ether = 150, BuildTime = 46, ProducedBy = DataType.BUILDING_DeepNest })
.AddPart(new EntityProductionModel
{ Alloy = 150, Ether = 150, BuildTime = 46, ProducedBy = DataType.BUILDING_DeepNest })
},
{
DataType.UPGRADE_WraithBowRange,
@ -1747,7 +1792,8 @@ public class DATA
Id = DataType.BUILDING_Neurocyte,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityProductionModel { Alloy = 50, Ether = 75, BuildTime = 29, ProducedBy = DataType.BUILDING_Neurocyte })
.AddPart(new EntityProductionModel
{ Alloy = 50, Ether = 75, BuildTime = 29, ProducedBy = DataType.BUILDING_Neurocyte })
},
{
@ -1766,7 +1812,8 @@ public class DATA
Id = DataType.BUILDING_Neurocyte,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 80, BuildTime = 60, ProducedBy = DataType.BUILDING_Neurocyte })
.AddPart(new EntityProductionModel
{ Alloy = 100, Ether = 80, BuildTime = 60, ProducedBy = DataType.BUILDING_Neurocyte })
.AddPart(new EntityVanguardAddedModel
{ ReplaceId = DataType.UPGRADE_Offering, ImmortalId = DataType.IMMORTAL_Xol })
},
@ -1782,7 +1829,8 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "CAPSLOCK", HotkeyGroup = "TAB", HoldSpace = false })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 125, BuildTime = 80, ProducedBy = DataType.BUILDING_RedVale })
.AddPart(new EntityProductionModel
{ Alloy = 100, Ether = 125, BuildTime = 80, ProducedBy = DataType.BUILDING_RedVale })
.AddPart(new EntityRequirementModel
{
Id = DataType.BUILDING_RedVale,
@ -1808,7 +1856,8 @@ public class DATA
Id = DataType.BUILDING_RedVale,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 120, BuildTime = 80, ProducedBy = DataType.BUILDING_RedVale })
.AddPart(new EntityProductionModel
{ Alloy = 75, Ether = 120, BuildTime = 80, ProducedBy = DataType.BUILDING_RedVale })
.AddPart(new EntityVanguardReplacedModel
{ ImmortalId = DataType.IMMORTAL_Xol, ReplacedById = DataType.ABILITY_BirthingStorm })
},
@ -1823,26 +1872,27 @@ public class DATA
Id = DataType.BUILDING_RedVale,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 120, BuildTime = 80, ProducedBy = DataType.BUILDING_RedVale })
.AddPart(new EntityProductionModel
{ Alloy = 75, Ether = 120, BuildTime = 80, ProducedBy = DataType.BUILDING_RedVale })
.AddPart(new EntityVanguardAddedModel
{ ImmortalId = DataType.IMMORTAL_Mala, ReplaceId = DataType.ABILITY_BloodPlague })
},
// Passives
// Neutral
{
DataType.PASSIVE_Detection,
new EntityModel(DataType.PASSIVE_Detection, EntityType.Passive)
.AddPart(new EntityInfoModel
{
Name = "Detection", Descriptive = DescriptiveType.Passive,
Description =
@"Unit can see all hidden units in its detection radius."
})
.AddPart(new EntityFactionModel { Faction = DataType.Any })
},
{
DataType.PASSIVE_Detection,
new EntityModel(DataType.PASSIVE_Detection, EntityType.Passive)
.AddPart(new EntityInfoModel
{
Name = "Detection", Descriptive = DescriptiveType.Passive,
Description =
@"Unit can see all hidden units in its detection radius."
})
.AddPart(new EntityFactionModel { Faction = DataType.Any })
},
{
DataType.PASSIVE_BastionPassives,
new EntityModel(DataType.PASSIVE_BastionPassives, EntityType.Passive)
@ -2036,7 +2086,7 @@ public class DATA
})
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
},
{
DataType.PASSIVE_HallowedWeapons,
new EntityModel(DataType.PASSIVE_HallowedWeapons, EntityType.Passive)
@ -2289,20 +2339,20 @@ public class DATA
{ Id = DataType.UPGRADE_XacalDamage, Requirement = RequirementType.Research_Upgrade })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
},
{
DataType.PASSIVE_CastingFromBlood,
new EntityModel(DataType.PASSIVE_CastingFromBlood, EntityType.Passive)
.AddPart(new EntityInfoModel
{
Name = "Cast From Blood", Descriptive = DescriptiveType.Ability,
Description =
@"This unit can spend life to cast abilities when it doesn't have enough energy.",
Notes = "They must have at least one remaining hitpoint after to perform Cast From Blood."
})
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
},
DataType.PASSIVE_CastingFromBlood,
new EntityModel(DataType.PASSIVE_CastingFromBlood, EntityType.Passive)
.AddPart(new EntityInfoModel
{
Name = "Cast From Blood", Descriptive = DescriptiveType.Ability,
Description =
@"This unit can spend life to cast abilities when it doesn't have enough energy.",
Notes = "They must have at least one remaining hitpoint after to perform Cast From Blood."
})
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
},
{
DataType.PASSIVE_OssifyingSwarm,
new EntityModel(DataType.PASSIVE_OssifyingSwarm, EntityType.Passive)
@ -2401,8 +2451,7 @@ public class DATA
@"Spawns a mine that reveals enemy units, slows them, and makes them take increased damage for a duration."
})
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath })
.AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "D", HoldSpace = true})
.AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "D", HoldSpace = true })
.AddPart(new EntityProductionModel { DefensiveLayer = 30, Cooldown = 40 })
.AddPart(new EntityRequirementModel { Id = DataType.UPGRADE_RadiantWard })
.AddPart(new EntityVitalityModel
@ -2591,7 +2640,7 @@ public class DATA
.AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "D" })
.AddPart(new EntityVanguardAddedModel
{ ImmortalId = DataType.IMMORTAL_Xol, ReplaceId = DataType.ABILITY_CullingStrike })
.AddPart(new EntityProductionModel { Energy = 40, Cooldown = 4})
.AddPart(new EntityProductionModel { Energy = 40, Cooldown = 4 })
.AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru })
},
{
@ -2686,8 +2735,11 @@ public class DATA
{ ImmortalId = DataType.IMMORTAL_Mala, ReplaceId = DataType.UNIT_Acaaluk })
.AddPart(new EntityProductionModel { Energy = 80, BuildTime = 10, Cooldown = 30 })
.AddPart(new EntitySupplyModel { Takes = 0 })
.AddPart(new EntityVitalityModel { Health = 300, DefenseLayer = 100, Armor = ArmorType.Heavy,
Lasts = 75, Vision = 1000})
.AddPart(new EntityVitalityModel
{
Health = 300, DefenseLayer = 100, Armor = ArmorType.Heavy,
Lasts = 75, Vision = 1000
})
.AddPart(new EntityMovementModel { Speed = 0, Movement = MovementType.Ground })
.AddPart(new EntityWeaponModel
{
@ -3021,9 +3073,12 @@ public class DATA
Id = DataType.BUILDING_KeeperOfTheHardenedFlames,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityWeaponModel {Damage = 14, Range = 700, SecondsBetweenAttacks = 1.8f, Targets
= TargetType.All})
.AddPart(new EntityIdPassiveModel {Id = DataType.PASSIVE_HallowedWeapons})
.AddPart(new EntityWeaponModel
{
Damage = 14, Range = 700, SecondsBetweenAttacks = 1.8f, Targets
= TargetType.All
})
.AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_HallowedWeapons })
.AddPart(new EntityVitalityModel
{ Health = 300, DefenseLayer = 150, Armor = ArmorType.Heavy, IsStructure = true })
.AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_PsalmOfFire })

17
Model/Entity/Data/Ids_Entity.cs

@ -4,7 +4,7 @@ public static class DataType
{
public static string Any = "Any";
public static string None = "None";
public static string PYREEVENT_TowerKilled = "9a923928-b016-49f2-8c7d-950abf09e287";
public static string PYREEVENT_CampTaken = "cc27a9b2-69e2-4322-8102-7a9f8bea7871";
public static string PYREEVENT_MinerTaken = "5b158cf2-2810-4a2a-8131-c4fe4b392ce9";
@ -17,7 +17,7 @@ public static class DataType
public static string FAMILY_Rae = "ce8d60f3-b590-4619-ad90-27e65f77312b";
public static string FAMILY_Demonic = "f61a3630-9474-4ec3-bc71-997cacc52bc1";
public static string FAMILY_NazRa = "56cc934f-57a9-442c-909a-25690f836679";
public static string FACTION_Neutral = "95da29af-99da-45fe-80f6-4ae1cc0d0f47";
public static string FACTION_Aru = "fb103962-7518-48df-b7d9-83906a009db8";
public static string FACTION_Iratek = "dbc12bda-b4f2-4fa0-8270-18dc1646d62d";
@ -55,8 +55,7 @@ public static class DataType
public static string ISPELL_RedTithe = "57008163-5e3a-4b95-98f3-d00b54e18684";
public static string ISPELL_RainOfBlood = "792df385-c66a-4710-9f75-97731897a565";
public static string IPASSIVE_HealingGround = "3ec17526-8dc5-4592-9c15-ef1d9b1ca2f6";
public static string IPASSIVE_Expansionist = "b6cd4335-2165-44c3-b3dc-4500c0111870";
@ -126,7 +125,7 @@ public static class DataType
public static string UPGRADE_Stalk = "36fbc2c0-e9e3-4f54-a79a-981db908c25c";
public static string UPGRADE_Ambush = "6cf83dc9-717f-4fa9-b417-a3371474a1da";
public static string PASSIVE_Detection = "434468fa-83b2-4fc9-a38c-1a3d00bcf055";
public static string PASSIVE_WraithBowRange = "196dd8a6-2044-44e1-aac4-fbaa40552699";
@ -160,9 +159,9 @@ public static class DataType
public static string PASSIVE_HallowingRites = "9c8ae47b-954e-4a17-8f35-f128c9114b61";
public static string PASSIVE_RegentsWrath = "f111f004-6548-4430-9d13-ef44ab108ae7";
public static string PASSIVE_PsalmOfFire = "d28f6b7c-d319-4fb8-bdd4-92ede40a0751";
public static string PASSIVE_HallowedWeapons = "f9ac4b3e-d02d-42d4-8d9d-beb9c5d7edcb";
public static string PASSIVE_Zeal = "62c4942b-5578-422d-8d4e-d1789f4efa68";
public static string PASSIVE_HallowedGround = "bdb28984-246f-4642-84ab-9e83c02b3e2e";
public static string PASSIVE_Rootway = "46768d4a-5047-4973-b5ca-995cda25ee8d";
@ -181,9 +180,9 @@ public static class DataType
public static string PASSIVE_OssifyingSwarm = "b8897247-8393-416e-b246-409a6b3263c2";
public static string PASSIVE_CastingFromBlood = "c97d1cf1-67d9-402b-9fa1-1abb9bfd7bfd";
public static string PASSIVE_QuenchingScythes = "dbf07db4-e7b6-4f81-9f8e-e5391850eead";
public static string PASSIVE_AaroxBurn = "921fe250-2b97-40c0-9765-9e6c1e766dd5";

1
Model/Entity/Parts/EntityFactionModel.cs

@ -1,5 +1,4 @@
using Model.Entity.Data;
using Model.Types;
namespace Model.Entity.Parts;

12
Model/Hotkeys/HotkeyModel.cs

@ -62,8 +62,8 @@ public class HotkeyModel
PositionX = 4,
PositionY = 0
},
new()
{
KeyText = "`",
@ -71,7 +71,7 @@ public class HotkeyModel
PositionX = 0,
PositionY = 1
},
new()
{
KeyText = "Q",
@ -100,7 +100,7 @@ public class HotkeyModel
PositionX = 4,
PositionY = 1
},
new()
{
KeyText = "CAPSLOCK",
@ -108,7 +108,7 @@ public class HotkeyModel
PositionX = 0,
PositionY = 2
},
new()
{
KeyText = "A",
@ -130,7 +130,7 @@ public class HotkeyModel
PositionX = 3,
PositionY = 2
},
new()
{
KeyText = "F",

4
Model/Model.csproj

@ -4,7 +4,7 @@
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="YamlDotNet" Version="11.2.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1"/>
<PackageReference Include="YamlDotNet" Version="11.2.1"/>
</ItemGroup>
</Project>

1
Model/Website/WebPageModel.cs

@ -8,5 +8,4 @@ public class WebPageModel
public string Description { get; set; } = "Add description";
public string Href { get; set; } = null;
public string IsPrivate { get; set; } = "True";
}

2
Model/Website/WebSectionModel.cs

@ -10,7 +10,7 @@ public class WebSectionModel
public string Description { get; set; } = "Add description";
public int Order { get; set; } = 0;
public string IsPrivate { get; set; } = "True";
public string Icon { get; set; } = "fa-icons";
public bool OnlyIcon { get; set; } = false;

1
Services/IServices.cs

@ -29,7 +29,6 @@ public interface IToastService
public interface IDataCollectionService
{
public void SendEvent<T>(string eventName, T eventData);
}
public interface IStorageService

17
Services/Immortal/BuildOrderService.cs

@ -343,16 +343,10 @@ public class BuildOrderService : IBuildOrderService
var checkedInterval = _lastInterval;
if (supply == null || production == null || supply.Takes.Equals(0))
{
return 1;
}
if (supply == null || production == null || supply.Takes.Equals(0)) return 1;
var producedBy = production.ProducedBy;
if (producedBy == null)
{
return 1;
}
if (producedBy == null) return 1;
var uniqueCompleted = _buildOrder.UniqueCompleted[producedBy];
@ -372,7 +366,7 @@ public class BuildOrderService : IBuildOrderService
usedSlots += used.UsedSlots;
var duration = used.StopUsageTime - used.StartingUsageTime;
if (duration < shortestIncrement) shortestIncrement = duration;
}
}
if (usedSlots + supply.Takes <= trainingSlots)
{
@ -389,10 +383,7 @@ public class BuildOrderService : IBuildOrderService
checkedInterval += shortestIncrement;
didDelay = true;
if (shortestIncrement == int.MaxValue)
{
return null;
}
if (shortestIncrement == int.MaxValue) return null;
}
}

5
Services/Immortal/EntityFilterService.cs

@ -1,5 +1,4 @@
using Model.Entity.Data;
using Model.Types;
using static Services.IEntityFilterService;
namespace Services.Immortal;
@ -16,7 +15,9 @@ public class EntityFilterService : IEntityFilterService
{
private readonly List<string> _entityChoices = new();
private readonly List<string> _factionChoices = new() { DataType.Any, DataType.FACTION_QRath, DataType.FACTION_Aru };
private readonly List<string> _factionChoices = new()
{ DataType.Any, DataType.FACTION_QRath, DataType.FACTION_Aru };
private readonly List<string> _immortalChoices = new();
private string _entityType = EntityType.Army;
private string _searchText = "";

7
Services/Immortal/ImmortalSelectionService.cs

@ -5,15 +5,14 @@ namespace Services.Immortal;
public class ImmortalSelectionService : IImmortalSelectionService, IDisposable
{
private readonly IStorageService _storageService;
private string _selectedFaction = DataType.FACTION_QRath;
private string _selectedImmortal = DataType.IMMORTAL_Orzum;
private readonly IStorageService _storageService;
public ImmortalSelectionService(IStorageService storageService)
{
_storageService = storageService;
_storageService.Subscribe(RefreshDefaults);
RefreshDefaults();
@ -73,7 +72,7 @@ public class ImmortalSelectionService : IImmortalSelectionService, IDisposable
if (foundFaction != null) _selectedFaction = foundFaction;
if (foundImmortal != null) _selectedImmortal = foundImmortal;
NotifyDataChanged();
}

12
Services/Services.csproj

@ -15,15 +15,15 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Blazor-Analytics" Version="3.11.0" />
<PackageReference Include="Blazored.LocalStorage" Version="4.3.0-preview.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.ProtectedBrowserStorage" Version="5.0.0-rc.1.20451.17" />
<PackageReference Include="Microsoft.JSInterop" Version="7.0.0-preview.2.22153.2" />
<PackageReference Include="YamlDotNet" Version="11.2.1" />
<PackageReference Include="Blazor-Analytics" Version="3.11.0"/>
<PackageReference Include="Blazored.LocalStorage" Version="4.3.0-preview.1"/>
<PackageReference Include="Microsoft.AspNetCore.Components.ProtectedBrowserStorage" Version="5.0.0-rc.1.20451.17"/>
<PackageReference Include="Microsoft.JSInterop" Version="7.0.0-preview.2.22153.2"/>
<PackageReference Include="YamlDotNet" Version="11.2.1"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Model\Model.csproj" />
<ProjectReference Include="..\Model\Model.csproj"/>
</ItemGroup>
</Project>

25
Services/Website/DataCollectionService.cs

@ -1,6 +1,4 @@
using Blazor.Analytics;
using Blazored.LocalStorage;
using Model.Feedback;
namespace Services.Website;
@ -14,37 +12,34 @@ public class DataCollectionKeys
public class DataCollectionService : IDataCollectionService, IDisposable
{
private readonly IAnalytics _globalTracking;
private readonly IStorageService _storageService;
private bool _isEnabled = false;
private readonly IAnalytics _globalTracking;
private bool _isEnabled;
public DataCollectionService(IAnalytics globalTracking,
IStorageService storageService)
{
_globalTracking = globalTracking;
_storageService = storageService;
_storageService.Subscribe(Refresh);
Refresh();
}
public void SendEvent<T>(string eventName, T eventData)
{
if (_isEnabled) _globalTracking.TrackEvent(eventName, eventData);
}
void IDisposable.Dispose()
{
_storageService.Unsubscribe(Refresh);
}
private void Refresh()
{
_isEnabled = _storageService.GetValue<bool>(StorageKeys.EnabledDataCollection);
}
public void SendEvent<T>(string eventName, T eventData)
{
if (_isEnabled)
{
_globalTracking.TrackEvent(eventName, eventData);
}
}
}

11
Services/Website/DialogService.cs

@ -1,7 +1,4 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;
using Model.Entity.Data;
using Model.Website;
namespace Services.Website;
@ -18,11 +15,7 @@ public class DialogService : IDialogService
{
private DialogContents _dialogContents;
public DialogService()
{
}
public bool IsVisible { get; set; }
public bool IsVisible { get; set; }
public void Subscribe(Action action)
{
@ -38,7 +31,7 @@ public class DialogService : IDialogService
{
_dialogContents = dialogContents;
IsVisible = true;
NotifyDataChanged();
}

4
Services/Website/PermissionService.cs

@ -4,8 +4,8 @@ namespace Services.Website;
public class PermissionService : IPermissionService, IDisposable
{
private IJSRuntime _jsRuntime;
private readonly IStorageService _storageService;
private IJSRuntime _jsRuntime;
private IToastService _toastService;
private bool isLoaded;
private bool isStorageEnabled = false;
@ -15,7 +15,7 @@ public class PermissionService : IPermissionService, IDisposable
_jsRuntime = jsRuntime;
_toastService = toastService;
_storageService = storageService;
_storageService.Subscribe(NotifyDataChanged);
}

8
Services/Website/SearchService.cs

@ -61,7 +61,7 @@ public class SearchService : ISearchService
{
Title = webPage.Name,
PointType = "WebPage",
Summary = $"{webPage.Description}",
Summary = $"{webPage.Description}",
Href = webPage.Href
});
@ -73,7 +73,7 @@ public class SearchService : ISearchService
SearchPoints.Add(new SearchPointModel
{
Title = note.Name,
PointType = "Note",
PointType = "Note",
Href = note.GetNoteLink(),
Summary = note.Description
});
@ -84,13 +84,13 @@ public class SearchService : ISearchService
foreach (var entity in DATA.Get().Values)
{
var summary =
var summary =
entity.Info().Description.Length > 35
? entity.Info().Description.Substring(0, 30).Trim() + "..."
: entity.Info().Description.Length > 0
? entity.Info().Description
: "";
SearchPoints.Add(new SearchPointModel
{
Title = entity.Info().Name,

1
Services/Website/StorageService.cs

@ -93,6 +93,7 @@ public class StorageService : IStorageService
}
private event Action OnChange = null!;
private void NotifyDataChanged()
{
OnChange();

5
TestAutomation/BaseTest.cs

@ -35,10 +35,7 @@ public class BaseTest
options.AcceptInsecureCertificates = true;
if (DeploymentType.Equals(DeploymentType.Dev))
{
options.AddArgument("--headless");
}
if (DeploymentType.Equals(DeploymentType.Dev)) options.AddArgument("--headless");
options.AddArgument("--ignore-certificate-errors");
options.AddArgument("--start-maximized");
options.AddArgument("--test-type");

34
TestAutomation/Pages/DatabasePage.cs

@ -6,39 +6,41 @@ namespace TestAutomation.Pages;
public class DatabasePage : BaseElement
{
public DatabasePage(Website website) : base(website)
{
}
private IWebElement FilterNameInput => Website.Find("filterName");
private ReadOnlyCollection<IWebElement> EntityNames() =>
Website.FindAll("entityName");
private IWebElement EntityName(string entityType, string entityName) =>
Website.Find("entityName",
private ReadOnlyCollection<IWebElement> EntityNames()
{
return Website.FindAll("entityName");
}
private IWebElement EntityName(string entityType, string entityName)
{
return Website.Find("entityName",
$"{entityType.ToLower()}-{entityName.ToLower()}");
public DatabasePage(Website website) : base(website) { }
}
public DatabasePage FilterName(string name)
{
Website.EnterInput(FilterNameInput, name);
return this;
}
public DatabasePage GetEntityName(string entityType, string entityName, out string result)
{
result = EntityName(entityType, entityName).Text;
return this;
}
public DatabasePage GetEntityName(int index,out string result)
public DatabasePage GetEntityName(int index, out string result)
{
result = EntityNames()[index].Text;
return this;
}
}

15
TestAutomation/Pages/DatabaseSinglePage.cs

@ -5,13 +5,15 @@ namespace TestAutomation.Pages;
public class DatabaseSinglePage : BaseElement
{
public DatabaseSinglePage(Website website) : base(website)
{
}
private IWebElement EntityName => Website.Find("entityName");
private IWebElement EntityHealth => Website.Find("entityHealth");
private IWebElement InvalidSearch => Website.Find("invalidSearch");
private IWebElement ValidSearch => Website.Find("validSearch");
public DatabaseSinglePage(Website website) : base(website) { }
public DatabaseSinglePage GetEntityName(out string result)
@ -19,23 +21,22 @@ public class DatabaseSinglePage : BaseElement
result = EntityName.Text;
return this;
}
public DatabaseSinglePage GetEntityHealth(out string result)
{
result = EntityHealth.Text;
return this;
}
public DatabaseSinglePage GetInvalidSearch(out string result)
{
result = InvalidSearch.Text;
return this;
}
public DatabaseSinglePage GetValidSearch(out string result)
{
result = ValidSearch.Text;
return this;
}
}

8
TestAutomation/Shared/NavigationBar.cs

@ -1,13 +1,13 @@
using TestAutomation.Enums;
using TestAutomation.Utils;
namespace TestAutomation.Shared;
public class NavigationBar : BaseElement
{
public NavigationBar(Website website) : base(website) { }
public NavigationBar(Website website) : base(website)
{
}
private IWebElement HomeLink => Website.FindScreenSpecific("homeLink");
private IWebElement SearchButton => Website.FindScreenSpecific("searchButton");

3
TestAutomation/Shared/WebsiteSearchDialog.cs

@ -1,4 +1,3 @@
using Discord.Rest;
using TestAutomation.Utils;
namespace TestAutomation.Shared;
@ -10,7 +9,7 @@ public class WebsiteSearchDialog : BaseElement
}
public IWebElement SearchBackground => Website.Find("searchBackground");
public IWebElement SearchInput => Website.Find("searchInput");
public NavigationBar CloseDialog()

22
TestAutomation/TestAutomation.csproj

@ -9,20 +9,20 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Discord.Net.Webhook" Version="3.6.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0-preview.2.22152.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.2.0" />
<PackageReference Include="NUnit.Analyzers" Version="3.2.0" />
<PackageReference Include="coverlet.collector" Version="3.1.0" />
<PackageReference Include="Selenium.WebDriver" Version="4.1.0" />
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="101.0.4951.4100" />
<PackageReference Include="Selenium.WebDriver.GeckoDriver" Version="0.31.0" />
<PackageReference Include="Discord.Net.Webhook" Version="3.6.0"/>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0-preview.2.22152.2"/>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0"/>
<PackageReference Include="NUnit" Version="3.13.2"/>
<PackageReference Include="NUnit3TestAdapter" Version="4.2.0"/>
<PackageReference Include="NUnit.Analyzers" Version="3.2.0"/>
<PackageReference Include="coverlet.collector" Version="3.1.0"/>
<PackageReference Include="Selenium.WebDriver" Version="4.1.0"/>
<PackageReference Include="Selenium.WebDriver.ChromeDriver" Version="101.0.4951.4100"/>
<PackageReference Include="Selenium.WebDriver.GeckoDriver" Version="0.31.0"/>
</ItemGroup>
<ItemGroup>
<Folder Include="Pages\" />
<Folder Include="Pages\"/>
</ItemGroup>
</Project>

48
TestAutomation/TestSearchFeatures.cs

@ -17,7 +17,7 @@ public class TestSearchFeatures : BaseTest
.CloseDialog()
.ClickHomeLink();
}
[Test]
public void DesktopSearchForThrone()
{
@ -31,56 +31,58 @@ public class TestSearchFeatures : BaseTest
.SelectSearchEntity("Throne")
.GetEntityName(out var name)
.GetEntityHealth(out var health);
TestReport.CheckPassed(name.Equals("Throne"), new TestMessage(){ Description = "Couldn't find Throne via search."});
TestReport.CheckPassed(!health.Trim().Equals(""), new TestMessage(){ Description = "Throne has no visible health!"});
TestReport.CheckPassed(name.Equals("Throne"),
new TestMessage { Description = "Couldn't find Throne via search." });
TestReport.CheckPassed(!health.Trim().Equals(""),
new TestMessage { Description = "Throne has no visible health!" });
}
[Test]
public void DesktopFilterForThrone()
{
TestReport.CreateTest();
Website.WebDriver.Navigate().GoToUrl(WebsiteUrl + "/database");
Website.DatabasePage
.FilterName("Throne")
.GetEntityName(0, out var name);
TestReport.CheckPassed(name.Equals("Throne"),
new TestMessage(){ Description = "Couldn't find Throne via filter."});
TestReport.CheckPassed(name.Equals("Throne"),
new TestMessage { Description = "Couldn't find Throne via filter." });
}
[Test]
public void SeeThroneByDefault()
{
TestReport.CreateTest();
Website.WebDriver.Navigate().GoToUrl(WebsiteUrl + "/database");
Website.DatabasePage
.GetEntityName( "army", "throne", out var name);
TestReport.CheckPassed(name.Equals("Throne"),
new TestMessage(){ Description = "Couldn't find Throne on the page by default."});
.GetEntityName("army", "throne", out var name);
TestReport.CheckPassed(name.Equals("Throne"),
new TestMessage { Description = "Couldn't find Throne on the page by default." });
}
[Test]
public void DirectLinkNotThroneFailure()
{
TestReport.CreateTest();
Website.WebDriver.Navigate().GoToUrl(WebsiteUrl + "/database/not throne");
Website.DatabaseSinglePage
.GetInvalidSearch(out var invalidSearch)
.GetValidSearch(out var validSearch);
TestReport.CheckPassed(invalidSearch.Equals("not throne"),
new TestMessage(){ Description = "Couldn't find invalid search text on the page."});
TestReport.CheckPassed(validSearch.Equals("Throne"),
new TestMessage(){ Description = "Couldn't find valid search text on the page."});
TestReport.CheckPassed(invalidSearch.Equals("not throne"),
new TestMessage { Description = "Couldn't find invalid search text on the page." });
TestReport.CheckPassed(validSearch.Equals("Throne"),
new TestMessage { Description = "Couldn't find valid search text on the page." });
Website.WebDriver.Navigate().GoToUrl(WebsiteUrl + "/database/not throne");
}
}

32
TestAutomation/Utils/Website.cs

@ -8,7 +8,7 @@ namespace TestAutomation.Utils;
public class Website
{
public readonly ScreenType ScreenType = ScreenType.Desktop;
public Website(IWebDriver webDriver)
{
WebDriver = webDriver;
@ -17,10 +17,10 @@ public class Website
HarassCalculatorPage = new HarassCalculatorPage(this);
DatabasePage = new DatabasePage(this);
DatabaseSinglePage = new DatabaseSinglePage(this);
// Navigation
NavigationBar = new NavigationBar(this);
// Dialogs
WebsiteSearchDialog = new WebsiteSearchDialog(this);
}
@ -36,7 +36,7 @@ public class Website
public IWebElement FindScreenSpecific(string byId)
{
var screenSpecificId = $"{ScreenType.ToString().ToLower()}-{byId}";
try
{
return WebDriver.FindElement(By.Id(screenSpecificId));
@ -44,11 +44,11 @@ public class Website
catch (Exception e)
{
throw new Exception($"Couldn't find {screenSpecificId}. Element does not exist on current page. " +
$"\n\nPerhaps an Id is missing.");
"\n\nPerhaps an Id is missing.");
}
}
public IWebElement Find(string byId, string withParentId)
{
IWebElement parent;
@ -60,9 +60,9 @@ public class Website
catch (Exception e)
{
throw new Exception($"Couldn't find parent {withParentId}. Element does not exist on current page. " +
$"\n\nPerhaps an Id is missing.");
"\n\nPerhaps an Id is missing.");
}
try
{
return parent.FindElement(By.Id(byId));
@ -70,10 +70,10 @@ public class Website
catch (Exception e)
{
throw new Exception($"Couldn't find {byId}. Element does not exist on current page. " +
$"\n\nPerhaps an Id is missing.");
"\n\nPerhaps an Id is missing.");
}
}
public IWebElement Find(string byId)
{
try
@ -83,10 +83,10 @@ public class Website
catch (Exception e)
{
throw new Exception($"Couldn't find {byId}. Element does not exist on current page. " +
$"\n\nPerhaps an Id is missing.");
"\n\nPerhaps an Id is missing.");
}
}
public ReadOnlyCollection<IWebElement> FindAll(string byId)
{
try
@ -96,11 +96,11 @@ public class Website
catch (Exception e)
{
throw new Exception($"Couldn't find {byId}. Element does not exist on current page. " +
$"\n\nPerhaps an Id is missing.");
"\n\nPerhaps an Id is missing.");
}
}
public IWebElement FindButtonWithLabel(string label)
{
try
@ -112,7 +112,7 @@ public class Website
throw new Exception($"Couldn't find with label: {label}. Element does not exist on current page. ");
}
}
//@FindBy(xpath = "//div[@label='First Name']")
public IList<IWebElement> FindChildren(string ofId, string tagname)
@ -139,7 +139,7 @@ public class Website
.Click()
.Perform();
}
public IWebElement Click(IWebElement element)
{
try

Loading…
Cancel
Save