Unfinished training queue code
This commit is contained in:
Binary file not shown.
+4
-4
@@ -20,10 +20,10 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Markdig" Version="0.28.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0-preview.2.22153.2" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0-preview.2.22153.2" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.0-preview.2.22153.2" />
|
||||
<PackageReference Include="Markdig" Version="0.30.0" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0-preview.3.22178.4" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0-preview.3.22178.4" PrivateAssets="all" />
|
||||
<PackageReference Include="Microsoft.Extensions.Localization" Version="7.0.0-preview.3.22178.4" />
|
||||
<!--
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.0-preview.2.22153.1" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Core" Version="7.0.0-preview.2.22153.1" />
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
@layout PageLayout
|
||||
|
||||
<DevOnlyComponent>
|
||||
<HarassCalculatorPage></HarassCalculatorPage>
|
||||
<BuildCalculatorPage></BuildCalculatorPage>
|
||||
</DevOnlyComponent>
|
||||
|
||||
<HomePage/>
|
||||
@@ -11,18 +11,18 @@
|
||||
</FormDisplayComponent>
|
||||
<div class="bankRow">
|
||||
<FormDisplayComponent Label="Alloy">
|
||||
<Display>@economy.Alloy</Display>
|
||||
<Display>@_economy.Alloy</Display>
|
||||
</FormDisplayComponent>
|
||||
<FormDisplayComponent Label="Ether">
|
||||
<Display>@economy.Ether</Display>
|
||||
<Display>@_economy.Ether</Display>
|
||||
</FormDisplayComponent>
|
||||
</div>
|
||||
<div class="bankRow">
|
||||
<FormDisplayComponent Label="Pyre">
|
||||
<Display>@economy.Pyre</Display>
|
||||
<Display>@_economy.Pyre</Display>
|
||||
</FormDisplayComponent>
|
||||
<FormDisplayComponent Label="Supply">
|
||||
<Display>@supplyTaken / @supplyGranted (@(supplyGranted / 16)@(extraBuildings > 0 ? "+" + extraBuildings : ""))</Display>
|
||||
<Display>@_supplyTaken / @_supplyGranted (@(_supplyGranted / 16)@(_extraBuildings > 0 ? "+" + _extraBuildings : ""))</Display>
|
||||
</FormDisplayComponent>
|
||||
</div>
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
<div class="workerText">Workers</div>
|
||||
<div class="bankRow">
|
||||
<FormDisplayComponent Label="Current">
|
||||
<Display>@economy.WorkerCount</Display>
|
||||
<Display>@_economy.WorkerCount</Display>
|
||||
</FormDisplayComponent>
|
||||
<FormDisplayComponent Label="Busy">
|
||||
<Display>@economy.BusyWorkerCount</Display>
|
||||
<Display>@_economy.BusyWorkerCount</Display>
|
||||
</FormDisplayComponent>
|
||||
<FormDisplayComponent Label="Creating">
|
||||
<Display>@economy.CreatingWorkerCount</Display>
|
||||
<Display>@_economy.CreatingWorkerCount</Display>
|
||||
</FormDisplayComponent>
|
||||
</div>
|
||||
</div>
|
||||
@@ -68,10 +68,10 @@
|
||||
[Inject]
|
||||
IEconomyService EconomyService { get; set; } = default!;
|
||||
|
||||
EconomyModel economy = new();
|
||||
int supplyGranted;
|
||||
int supplyTaken;
|
||||
int extraBuildings;
|
||||
EconomyModel _economy = new();
|
||||
int _supplyGranted;
|
||||
int _supplyTaken;
|
||||
int _extraBuildings;
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
@@ -101,27 +101,27 @@
|
||||
|
||||
void OnBuildOrderChanged()
|
||||
{
|
||||
economy = EconomyService.GetEconomy(BuildOrderService.GetLastRequestInterval());
|
||||
_economy = EconomyService.GetEconomy(BuildOrderService.GetLastRequestInterval());
|
||||
|
||||
var ordersOverTime = BuildOrderService.GetOrders();
|
||||
|
||||
supplyTaken = (from ordersAtInterval in ordersOverTime
|
||||
_supplyTaken = (from ordersAtInterval in ordersOverTime
|
||||
from order in ordersAtInterval.Value
|
||||
where order.Supply() != null
|
||||
where order.Supply().Takes > 0
|
||||
select order.Supply().Takes).Sum();
|
||||
|
||||
supplyGranted = (from ordersAtInterval in ordersOverTime
|
||||
_supplyGranted = (from ordersAtInterval in ordersOverTime
|
||||
from order in ordersAtInterval.Value
|
||||
where order.Supply() != null
|
||||
where order.Supply().Grants > 0
|
||||
select order.Supply().Grants).Sum();
|
||||
|
||||
extraBuildings = 0;
|
||||
if (supplyGranted > 160)
|
||||
_extraBuildings = 0;
|
||||
if (_supplyGranted > 160)
|
||||
{
|
||||
extraBuildings = (supplyGranted - 160) / 16;
|
||||
supplyGranted = 160;
|
||||
_extraBuildings = (_supplyGranted - 160) / 16;
|
||||
_supplyGranted = 160;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,49 +1,10 @@
|
||||
@page "/economy-comparison"
|
||||
|
||||
@implements IDisposable
|
||||
@inject IEconomyComparisonService economyComparisonService
|
||||
@inject IEconomyComparisonService EconomyComparisonService
|
||||
@layout PageLayout
|
||||
|
||||
|
||||
<LayoutMediumContentComponent>
|
||||
|
||||
<AlertComponent Type="@SeverityType.Error">
|
||||
<Title>Contains Bugs</Title>
|
||||
<Message>None of these calculations and results have been verified. Use with caution. </Message>
|
||||
</AlertComponent>
|
||||
|
||||
<DevOnlyComponent>
|
||||
@foreach (var buildToCompare in economyComparisonService.BuildsToCompare)
|
||||
{
|
||||
foreach (var ordersAtTime in buildToCompare.BuildOrderModel.StartedOrders)
|
||||
{
|
||||
foreach (var order in ordersAtTime.Value)
|
||||
{
|
||||
<div>@ordersAtTime.Key - @order.Info().Name</div>
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@{
|
||||
float alloyHighest = 0;
|
||||
}
|
||||
@foreach (var buildToCompare in economyComparisonService.BuildsToCompare)
|
||||
{
|
||||
foreach (var economy in buildToCompare.EconomyOverTimeModel)
|
||||
{
|
||||
if (economy.Alloy > alloyHighest)
|
||||
{
|
||||
alloyHighest = economy.Alloy;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
<div>@alloyHighest</div>
|
||||
|
||||
</DevOnlyComponent>
|
||||
|
||||
<PaperComponent>
|
||||
<div>You</div>
|
||||
<EconomyInputComponent ForPlayer="0"/>
|
||||
@@ -65,7 +26,6 @@
|
||||
<ContentDividerComponent/>
|
||||
|
||||
<PaperComponent>
|
||||
|
||||
<InfoBodyComponent>
|
||||
<InfoQuestionComponent>
|
||||
What is this tool for?
|
||||
@@ -78,18 +38,13 @@
|
||||
</LayoutMediumContentComponent>
|
||||
|
||||
@code {
|
||||
|
||||
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
economyComparisonService.Subscribe(StateHasChanged);
|
||||
|
||||
EconomyComparisonService.Subscribe(StateHasChanged);
|
||||
}
|
||||
|
||||
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
economyComparisonService.Unsubscribe(StateHasChanged);
|
||||
EconomyComparisonService.Unsubscribe(StateHasChanged);
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user