Browse Source

feat(BuildCalc) Wait To button and some WIP code

main
Jonathan McCaffrey 4 years ago
parent
commit
89e12a8de0
  1. 2
      IGP/Pages/BuildCalculator/BuildCalculatorPage.razor
  2. 2
      IGP/Pages/BuildCalculator/Parts/HotkeyViewerComponent.razor
  3. 29
      IGP/Pages/BuildCalculator/Parts/OptionsComponent.razor
  4. 2
      IGP/Pages/Comparision/ComparisionPage.razor
  5. 11
      Model/BuildOrders/BuildOrderModel.cs
  6. 20
      Model/BuildOrders/BuildToCompareModel.cs
  7. 10
      Model/BuildOrders/ResearchSlot.cs
  8. 4
      Model/BuildOrders/TrainingCapacityUsedModel.cs
  9. 10
      Model/BuildOrders/TrainingSlot.cs
  10. 7
      Model/Economy/EconomyOverTimeModel.cs
  11. 123
      Model/Entity/Data/DATA.cs
  12. 14
      Model/Entity/Parts/EntityProductionModel.cs
  13. 6
      Model/Entity/Parts/EntityResearchCapacityModel.cs
  14. 6
      Model/Entity/Parts/EntityTrainingCapacityModel.cs
  15. 4
      Model/Model.csproj
  16. 10
      Model/TravelTime.cs
  17. 4
      Model/Variable.cs
  18. 2
      Services/IServices.cs
  19. 123
      Services/Immortal/BuildOrderService.cs
  20. 1
      Services/Immortal/DeprecatedBuildComparisionService.cs
  21. 191
      Services/Immortal/EconomyComparisonService.cs
  22. 36
      Services/Immortal/EconomyService.cs
  23. 4
      Services/Services.csproj
  24. 4
      Services/Website/SearchService.cs
  25. 6
      Services/Website/VariableService.cs

2
IGP/Pages/BuildCalculator/BuildCalculatorPage.razor

@ -267,7 +267,7 @@
return;
}
if (buildOrderService.Add(entity, economyService, toastService))
if (buildOrderService.Add(entity, economyService))
{
economyService.Calculate(buildOrderService, timingService, buildOrderService.GetLastRequestInterval());
}

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

@ -329,7 +329,7 @@
return;
}
if (buildOrderService.Add(entity, economyService, toastService))
if (buildOrderService.Add(entity, economyService))
{
economyService.Calculate(buildOrderService, timingService, buildOrderService.GetLastRequestInterval());
}

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

@ -13,11 +13,10 @@
<FormLabelComponent>Building Input Delay</FormLabelComponent>
<FormInfoComponent>Add a input delay to constructing buildings for simulating worker movement and player micro.</FormInfoComponent>
</FormNumberComponent>
<div class="optionRow">
<FormLayoutComponent>
<FormNumberComponent Max="600"
Min="0"
Min="1"
Value="@WaitTime"
OnChange="@OnWaitTimeChanged">
<FormLabelComponent>Wait Time</FormLabelComponent>
@ -25,15 +24,14 @@
<ButtonComponent OnClick="OnWaitClicked">Add Wait</ButtonComponent>
</FormLayoutComponent>
<FormLayoutComponent>
<FormNumberComponent Max="600"
Min="0"
Value="@WaitTime"
OnChange="@OnWaitTimeChanged">
<FormNumberComponent Max="2048"
Min="1"
Value="@WaitTo"
OnChange="@OnWaitToChanged">
<FormLabelComponent>Wait To</FormLabelComponent>
</FormNumberComponent>
<ButtonComponent OnClick="OnWaitClicked">Add Wait</ButtonComponent>
<ButtonComponent OnClick="OnWaitToClicked">Add Wait</ButtonComponent>
</FormLayoutComponent>
</div>
</FormLayoutComponent>
@ -45,8 +43,8 @@
</style>
@code {
public int WaitTime { get; set; } = 30;
public int WaitTo { get; set; } = 30;
private int WaitTime { get; set; } = 30;
private int WaitTo { get; set; } = 30;
void OnBuildingInputDelayChanged(ChangeEventArgs changeEventArgs)
@ -59,7 +57,12 @@
WaitTime = (int)changeEventArgs.Value!;
}
public void OnWaitClicked()
void OnWaitToChanged(ChangeEventArgs changeEventArgs)
{
WaitTo = (int)changeEventArgs.Value!;
}
private void OnWaitClicked()
{
if (buildOrderService.AddWait(WaitTime))
{
@ -67,9 +70,9 @@
}
}
public void OnWaitToClicked()
private void OnWaitToClicked()
{
if (buildOrderService.AddWait(WaitTime))
if (buildOrderService.AddWaitTo(WaitTo))
{
economyService.Calculate(buildOrderService, timingService, buildOrderService.GetLastRequestInterval());
}

2
IGP/Pages/Comparision/ComparisionPage.razor

@ -95,7 +95,7 @@ grid-template-areas: 'loader sand compare compare' ;">
{
return;
}
if (BuildOrderService.Add(entity, EconomyService, toastService))
if (BuildOrderService.Add(entity, EconomyService))
{
EconomyService.Calculate(BuildOrderService, TimingService, BuildOrderService.GetLastRequestInterval());
}

11
Model/BuildOrders/BuildOrderModel.cs

@ -29,17 +29,16 @@ public class BuildOrderModel
public Dictionary<string, int> UniqueCompletedCount { get; set; } = new();
public Dictionary<int, int> SupplyCountTimes { get; set; } = new();
public List<TrainingCapacityUsedModel> TrainingCapacityModels { get; set; } = new();
public Dictionary<string, Dictionary<int, List<EntityModel>>> UniqueCompleted { get; set; } = new();
public List<TrainingCapacityUsedModel> TrainingCapacityUsed { get; set; } = new();
public void Initialize(string faction)
{
string factionStartingTownHall = faction.Equals(DataType.FACTION_QRath) ? DataType.STARTING_TownHall_QRath :
var factionStartingTownHall = faction.Equals(DataType.FACTION_QRath) ? DataType.STARTING_TownHall_QRath :
faction.Equals(DataType.FACTION_Aru) ? DataType.STARTING_TownHall_Aru : "";
if (factionStartingTownHall.Equals(""))
{
throw new Exception("Reminder to add support to new factions");
}
if (factionStartingTownHall.Equals("")) throw new Exception("Reminder to add support to new factions");
StartedOrders = new Dictionary<int, List<EntityModel>>
{

20
Model/BuildOrders/BuildToCompareModel.cs

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using Model.Economy;
using Model.Entity;
@ -9,21 +8,24 @@ namespace Model.BuildOrders;
public class BuildToCompareModel
{
private int numberOfTownHallExpansions;
public string Faction { get; set; }
public EntityModel GetTownHallEntity => DATA.Get()[
Faction.Equals(DataType.FACTION_QRath) ? DataType.BUILDING_Acropolis
Faction.Equals(DataType.FACTION_QRath)
? DataType.BUILDING_Acropolis
: DataType.BUILDING_GroveHeart];
public EntityModel GetTownHallMining2Entity => DATA.Get()[
Faction.Equals(DataType.FACTION_QRath) ? DataType.BUPGRADE_MiningLevel2_QRath
Faction.Equals(DataType.FACTION_QRath)
? DataType.BUPGRADE_MiningLevel2_QRath
: DataType.BUPGRADE_MiningLevel2_Aru];
public EntityModel GetTownHallMining3Entity => DATA.Get()[
Faction.Equals(DataType.FACTION_QRath) ? DataType.BUPGRADE_MiningLevel3_QRath
Faction.Equals(DataType.FACTION_QRath)
? DataType.BUPGRADE_MiningLevel3_QRath
: DataType.BUPGRADE_MiningLevel3_Aru];
private int numberOfTownHallExpansions = 0;
public int NumberOfTownHallExpansions
{
get => numberOfTownHallExpansions;
@ -33,16 +35,12 @@ public class BuildToCompareModel
{
numberOfTownHallExpansions = value;
while (TimeToBuildTownHall.Count < numberOfTownHallExpansions)
{
TimeToBuildTownHall.Add((TimeToBuildTownHall.Count + 1) * 30);
}
while (TimeToBuildTownHall.Count > numberOfTownHallExpansions)
{
TimeToBuildTownHall.Remove(TimeToBuildTownHall.Last());
}
}
}
}
public List<int> TimeToBuildTownHall { get; set; } = new();

10
Model/BuildOrders/ResearchSlot.cs

@ -0,0 +1,10 @@
using Model.Entity.Data;
namespace Model.BuildOrders;
public class ResearchSlot
{
public int StartingInterval { get; set; } = 30;
public int Slots { get; set; } = 1;
public string ResearchType { get; set; } = DataType.BUILDING_Reliquary;
}

4
Model/BuildOrders/TrainingCapacityUsedModel.cs

@ -1,6 +1,4 @@

using Model.Entity.Data;
using Model.Entity.Data;
namespace Model.BuildOrders;

10
Model/BuildOrders/TrainingSlot.cs

@ -0,0 +1,10 @@
using Model.Entity.Data;
namespace Model.BuildOrders;
public class TrainingSlot
{
public int StartingInterval { get; set; } = 30;
public int Slots { get; set; } = 16;
public string ProductionType { get; set; } = DataType.BUILDING_LegionHall;
}

7
Model/Economy/EconomyOverTimeModel.cs

@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Model.BuildOrders;
using Model.Entity;
using Model.Types;
using System.Collections.Generic;
namespace Model.Economy;

123
Model/Entity/Data/DATA.cs

@ -446,7 +446,7 @@ public class DATA
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityVanguardAddedModel
{ ReplaceId = DataType.UNIT_Sipari, ImmortalId = DataType.IMMORTAL_Orzum })
.AddPart(new EntityProductionModel { Alloy = 100, BuildTime = 24 })
.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
@ -475,7 +475,7 @@ public class DATA
.AddPart(new EntityTierModel { Tier = 3 })
.AddPart(new EntityHotkeyModel { Hotkey = "R", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 200, Ether = 125, BuildTime = 40 })
.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
@ -514,7 +514,7 @@ public class DATA
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityVanguardAddedModel
{ ReplaceId = DataType.UNIT_Magi, ImmortalId = DataType.IMMORTAL_Ajari })
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 75, BuildTime = 35 })
.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 })
@ -548,7 +548,7 @@ public class DATA
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityVanguardAddedModel
{ ReplaceId = DataType.UNIT_Hallower, ImmortalId = DataType.IMMORTAL_Ajari })
.AddPart(new EntityProductionModel { Alloy = 150, Ether = 100, BuildTime = 40 })
.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 })
@ -584,7 +584,7 @@ public class DATA
.AddPart(new EntityFactionModel { Faction = FactionType.Aru })
.AddPart(new EntityVanguardAddedModel
{ ReplaceId = DataType.UNIT_Underspine, ImmortalId = DataType.IMMORTAL_Mala })
.AddPart(new EntityProductionModel { Alloy = 175, Ether = 50, BuildTime = 35 })
.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 })
@ -613,7 +613,7 @@ public class DATA
.AddPart(new EntityFactionModel { Faction = FactionType.Aru })
.AddPart(new EntityVanguardAddedModel
{ ReplaceId = DataType.UNIT_RedSeer, ImmortalId = DataType.IMMORTAL_Mala })
.AddPart(new EntityProductionModel { Alloy = 60, Ether = 150, BuildTime = 45 })
.AddPart(new EntityProductionModel { Alloy = 60, Ether = 150, BuildTime = 45, ProducedBy = DataType.BUILDING_AltarOfTheWorthy })
.AddPart(new EntitySupplyModel { Takes = 4 })
.AddPart(new EntityVitalityModel
{
@ -642,7 +642,7 @@ public class DATA
.AddPart(new EntityFactionModel { Faction = FactionType.Aru })
.AddPart(new EntityVanguardAddedModel
{ ReplaceId = DataType.UNIT_MaskedHunter, ImmortalId = DataType.IMMORTAL_Xol })
.AddPart(new EntityProductionModel { Alloy = 50, Ether = 0, BuildTime = 20 })
.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 })
@ -671,7 +671,7 @@ public class DATA
.AddPart(new EntityFactionModel { Faction = FactionType.Aru })
.AddPart(new EntityVanguardAddedModel
{ ReplaceId = DataType.UNIT_Bloodbound, ImmortalId = DataType.IMMORTAL_Xol })
.AddPart(new EntityProductionModel { Alloy = 80, Ether = 80, BuildTime = 35 })
.AddPart(new EntityProductionModel { Alloy = 80, Ether = 80, BuildTime = 35, ProducedBy = DataType.BUILDING_AltarOfTheWorthy })
.AddPart(new EntitySupplyModel { Takes = 4 })
.AddPart(new EntityVitalityModel
{
@ -707,14 +707,14 @@ public class DATA
{
Name = "Sipari", Descriptive = DescriptiveType.Frontliner,
Description =
@"Melee Warrior (Ground Unit) - Front-line warriors enchanced by <b>Hallowed Ground</b>."
@"Melee Warrior (Ground Unit) - Front-line warriors enhanced by <b>Hallowed Ground</b>."
})
.AddPart(new EntityTierModel { Tier = 1 })
.AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "Z" })
.AddPart(new EntityVanguardReplacedModel
{ ImmortalId = DataType.IMMORTAL_Orzum, ReplacedById = DataType.VANGUARD_Zentari_Orzum })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 75, BuildTime = 25 })
.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
@ -745,7 +745,7 @@ public class DATA
.AddPart(new EntityTierModel { Tier = 1.5f })
.AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 75, BuildTime = 35 })
.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 })
@ -783,7 +783,7 @@ public class DATA
.AddPart(new EntityTierModel { Tier = 1.5f })
.AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 40, BuildTime = 30 })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 40, BuildTime = 30, ProducedBy = DataType.BUILDING_SoulFoundry })
.AddPart(new EntitySupplyModel { Takes = 4 })
.AddPart(new EntityRequirementModel
{
@ -818,7 +818,7 @@ public class DATA
.AddPart(new EntityTierModel { Tier = 2 })
.AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 125, Ether = 10, BuildTime = 35 })
.AddPart(new EntityProductionModel { Alloy = 125, Ether = 10, BuildTime = 35, ProducedBy = DataType.BUILDING_SoulFoundry })
.AddPart(new EntitySupplyModel { Takes = 4 })
.AddPart(new EntityVitalityModel { Health = 140, DefenseLayer = 100, Armor = ArmorType.Medium })
.AddPart(new EntityRequirementModel
@ -850,7 +850,7 @@ public class DATA
.AddPart(new EntityTierModel { Tier = 2 })
.AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 150, Ether = 75, BuildTime = 35 })
.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
@ -885,7 +885,7 @@ public class DATA
.AddPart(new EntityTierModel { Tier = 2 })
.AddPart(new EntityHotkeyModel { Hotkey = "W", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 190, Ether = 75, BuildTime = 35 })
.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 })
@ -919,7 +919,7 @@ public class DATA
.AddPart(new EntityVanguardReplacedModel
{ ImmortalId = DataType.IMMORTAL_Ajari, ReplacedById = DataType.VANGUARD_ArkMother_Ajari })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 150, Ether = 75, BuildTime = 35 })
.AddPart(new EntityProductionModel { Alloy = 150, Ether = 75, BuildTime = 35, ProducedBy = DataType.BUILDING_SoulFoundry })
.AddPart(new EntitySupplyModel { Takes = 5 })
.AddPart(new EntityRequirementModel
{
@ -951,7 +951,7 @@ public class DATA
.AddPart(new EntityTierModel { Tier = 3 })
.AddPart(new EntityHotkeyModel { Hotkey = "E", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 150, Ether = 75, BuildTime = 35 })
.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 })
@ -977,7 +977,7 @@ public class DATA
.AddPart(new EntityTierModel { Tier = 3 })
.AddPart(new EntityHotkeyModel { Hotkey = "A", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 250, Ether = 100, BuildTime = 50 })
.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
@ -1008,14 +1008,14 @@ public class DATA
{
Name = "Warden", Descriptive = DescriptiveType.Harrier,
Description =
@"Gunship (Flying Unit) - Air-to-ground specialist. Flight allos it to ignore terrain."
@"Gunship (Flying Unit) - Air-to-ground specialist. Flight also it to ignore terrain."
})
.AddPart(new EntityTierModel { Tier = 3 })
.AddPart(new EntityHotkeyModel { Hotkey = "R", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityVanguardReplacedModel
{ ImmortalId = DataType.IMMORTAL_Orzum, ReplacedById = DataType.VANGUARD_Sceptre_Orzum })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 175, Ether = 100, BuildTime = 40 })
.AddPart(new EntityProductionModel { Alloy = 175, Ether = 100, BuildTime = 40, ProducedBy = DataType.BUILDING_Angelarium })
.AddPart(new EntitySupplyModel { Takes = 6 })
.AddPart(new EntityRequirementModel
{
@ -1037,7 +1037,7 @@ public class DATA
.AddPart(new EntityTierModel { Tier = 3.5f })
.AddPart(new EntityHotkeyModel { Hotkey = "F", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 110, Ether = 175, BuildTime = 55 })
.AddPart(new EntityProductionModel { Alloy = 110, Ether = 175, BuildTime = 55, ProducedBy = DataType.BUILDING_Angelarium })
.AddPart(new EntitySupplyModel { Takes = 6 })
.AddPart(new EntityRequirementModel
{
@ -1097,7 +1097,7 @@ public class DATA
Requirement = RequirementType.Production_Building
})
.AddPart(new EntityFactionModel { Faction = FactionType.Aru })
.AddPart(new EntityProductionModel { Alloy = 50, BuildTime = 20 })
.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 })
@ -1125,7 +1125,7 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = FactionType.Aru })
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 30, BuildTime = 25 })
.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 })
@ -1156,7 +1156,7 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = FactionType.Aru })
.AddPart(new EntityProductionModel { Alloy = 80, Ether = 80, BuildTime = 30 })
.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 })
@ -1188,7 +1188,7 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "F", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = FactionType.Aru })
.AddPart(new EntityProductionModel { Alloy = 40, Ether = 140, BuildTime = 40 })
.AddPart(new EntityProductionModel { Alloy = 40, Ether = 140, BuildTime = 40, ProducedBy = DataType.BUILDING_AltarOfTheWorthy })
.AddPart(new EntitySupplyModel { Takes = 3 })
.AddPart(new EntityVitalityModel
{
@ -1225,7 +1225,7 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "Q", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = FactionType.Aru })
.AddPart(new EntityProductionModel { Alloy = 70, Ether = 50, BuildTime = 25 })
.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 })
@ -1255,7 +1255,7 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = FactionType.Aru })
.AddPart(new EntityProductionModel { Alloy = 95, Ether = 20, BuildTime = 30 })
.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 })
@ -1285,7 +1285,7 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = FactionType.Aru })
.AddPart(new EntityProductionModel { Alloy = 150, Ether = 80, BuildTime = 40 })
.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 })
@ -1320,7 +1320,7 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "E", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = FactionType.Aru })
.AddPart(new EntityProductionModel { Alloy = 40, Ether = 40, BuildTime = 30 })
.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 })
@ -1345,7 +1345,7 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "R", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = FactionType.Aru })
.AddPart(new EntityProductionModel { Alloy = 80, Ether = 50, BuildTime = 30 })
.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 })
@ -1367,7 +1367,7 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "W", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = FactionType.Aru })
.AddPart(new EntityProductionModel { Alloy = 80, Ether = 30, BuildTime = 30 })
.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 })
@ -1395,7 +1395,7 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "A", HoldSpace = true, HotkeyGroup = "Z" })
.AddPart(new EntityFactionModel { Faction = FactionType.Aru })
.AddPart(new EntityProductionModel { Alloy = 190, Ether = 150, BuildTime = 50 })
.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 })
@ -1430,7 +1430,7 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "TAB" })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 100, BuildTime = 100 })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 100, BuildTime = 100, ProducedBy = DataType.BUILDING_Reliquary })
.AddPart(new EntityRequirementModel
{
Id = DataType.BUILDING_Reliquary,
@ -1449,7 +1449,7 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "V", HotkeyGroup = "TAB" })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 80, Ether = 80, BuildTime = 34 })
.AddPart(new EntityProductionModel { Alloy = 80, Ether = 80, BuildTime = 34, ProducedBy = DataType.BUILDING_HouseOfFadingSaints })
.AddPart(new EntityRequirementModel
{
Id = DataType.BUILDING_HouseOfFadingSaints,
@ -1467,7 +1467,7 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "TAB", HoldSpace = true })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 100, BuildTime = 43 })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 100, BuildTime = 43, ProducedBy = DataType.BUILDING_EyeOfAros })
.AddPart(new EntityRequirementModel
{
Id = DataType.BUILDING_EyeOfAros,
@ -1487,7 +1487,7 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "TAB" })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 50, Ether = 100, BuildTime = 60 })
.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
@ -1503,7 +1503,7 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "TAB", HoldSpace = true })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 75, BuildTime = 29 })
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 75, BuildTime = 29, ProducedBy = DataType.BUILDING_HouseOfFadingSaints })
.AddPart(new EntityRequirementModel
{
Id = DataType.BUILDING_HouseOfFadingSaints,
@ -1517,7 +1517,7 @@ public class DATA
{ Name = "Windstep", Descriptive = DescriptiveType.Upgrade, Description = "Unlocks windstep." })
.AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "TAB" })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 50, Ether = 75, BuildTime = 55 })
.AddPart(new EntityProductionModel { Alloy = 50, Ether = 75, BuildTime = 55, ProducedBy = DataType.BUILDING_Reliquary })
.AddPart(new EntityRequirementModel
{ Id = DataType.BUILDING_Reliquary, Requirement = RequirementType.Production_Building })
},
@ -1531,9 +1531,9 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "TAB" })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 150, Ether = 100, BuildTime = 43 })
.AddPart(new EntityProductionModel { Alloy = 150, Ether = 100, BuildTime = 43, ProducedBy = DataType.BUILDING_Reliquary })
.AddPart(new EntityRequirementModel
{ Id = DataType.UPGRADE_ZephyrRange, Requirement = RequirementType.Production_Building })
{ Id = DataType.BUILDING_Reliquary, Requirement = RequirementType.Research_Building })
.AddPart(new EntityIdUpgradeModel { Id = DataType.UPGRADE_WindStep })
.AddPart(new EntityIdUpgradeModel { Id = DataType.UPGRADE_ZephyrRange })
},
@ -1547,7 +1547,7 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "TAB" })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 100, BuildTime = 60 })
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 100, BuildTime = 60, ProducedBy = DataType.BUILDING_HouseOfFadingSaints })
.AddPart(new EntityRequirementModel
{
Id = DataType.BUILDING_HouseOfFadingSaints,
@ -1564,7 +1564,7 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "Q", HoldSpace = true, HotkeyGroup = "TAB" })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 100, BuildTime = 43 })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 100, BuildTime = 43, ProducedBy = DataType.BUILDING_EyeOfAros })
.AddPart(new EntityRequirementModel
{
Id = DataType.BUILDING_EyeOfAros,
@ -1583,7 +1583,7 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "A", HoldSpace = true, HotkeyGroup = "TAB" })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 75, BuildTime = 45 })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 75, BuildTime = 45, ProducedBy = DataType.BUILDING_BearerOfTheCrown })
.AddPart(new EntityRequirementModel
{
Id = DataType.BUILDING_BearerOfTheCrown, Requirement = RequirementType.Production_Building
@ -1599,10 +1599,10 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "R", HoldSpace = true, HotkeyGroup = "TAB" })
.AddPart(new EntityFactionModel { Faction = FactionType.QRath })
.AddPart(new EntityProductionModel { Alloy = 150, Ether = 100, BuildTime = 30 })
.AddPart(new EntityProductionModel { Alloy = 150, Ether = 100, BuildTime = 30, ProducedBy = DataType.BUILDING_EyeOfAros })
.AddPart(new EntityRequirementModel
{
Id = DataType.BUILDING_BearerOfTheCrown, Requirement = RequirementType.Production_Building
Id = DataType.BUILDING_EyeOfAros, Requirement = RequirementType.Production_Building
})
},
// Upgrades
@ -1630,7 +1630,7 @@ public class DATA
Id = DataType.BUILDING_Neurocyte,
Requirement = RequirementType.Production_Building
})
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 80, BuildTime = 60 })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 80, BuildTime = 60, ProducedBy = DataType.BUILDING_Neurocyte })
},
{
DataType.UPGRADE_BloodMothersFevor,
@ -1643,15 +1643,15 @@ public class DATA
{ ImmortalId = DataType.IMMORTAL_Xol, ReplacedById = DataType.UPGRADE_Ambush })
.AddPart(new EntityRequirementModel
{
Id = DataType.BUILDING_AmberWomb,
Id = DataType.BUILDING_RedVale,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityRequirementModel
{
Id = DataType.BUILDING_Neurocyte,
Id = DataType.BUILDING_AltarOfTheWorthy,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 150, BuildTime = 80 })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 150, BuildTime = 80, ProducedBy = DataType.BUILDING_RedVale })
},
{
DataType.UPGRADE_DenInstinct,
@ -1664,7 +1664,7 @@ public class DATA
Id = DataType.BUILDING_Neurocyte,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 120, BuildTime = 45 })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 120, BuildTime = 45, ProducedBy = DataType.BUILDING_Neurocyte })
},
{
DataType.UPGRADE_PursuitLigaments,
@ -1677,7 +1677,7 @@ public class DATA
Id = DataType.BUILDING_Neurocyte,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 100, BuildTime = 45 })
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 100, BuildTime = 45, ProducedBy = DataType.BUILDING_Neurocyte })
},
{
DataType.UPGRADE_ResinantDeploy,
@ -1695,7 +1695,7 @@ public class DATA
Id = DataType.BUILDING_AmberWomb,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityProductionModel { Alloy = 50, Ether = 100, BuildTime = 43 })
.AddPart(new EntityProductionModel { Alloy = 50, Ether = 100, BuildTime = 43, ProducedBy = DataType.BUILDING_Neurocyte })
},
{
DataType.UPGRADE_XacalDamage,
@ -1708,7 +1708,7 @@ public class DATA
Id = DataType.BUILDING_Neurocyte,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 75, BuildTime = 60 })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 75, BuildTime = 60, ProducedBy = DataType.BUILDING_Neurocyte })
},
{
DataType.UPGRADE_BehemothCapacity,
@ -1721,7 +1721,7 @@ public class DATA
Id = DataType.BUILDING_DeepNest,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityProductionModel { Alloy = 150, Ether = 150, BuildTime = 46 })
.AddPart(new EntityProductionModel { Alloy = 150, Ether = 150, BuildTime = 46, ProducedBy = DataType.BUILDING_DeepNest })
},
{
DataType.UPGRADE_WraithBowRange,
@ -1739,7 +1739,7 @@ public class DATA
Id = DataType.BUILDING_Neurocyte,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityProductionModel { Alloy = 50, Ether = 75, BuildTime = 29 })
.AddPart(new EntityProductionModel { Alloy = 50, Ether = 75, BuildTime = 29, ProducedBy = DataType.BUILDING_Neurocyte })
},
{
@ -1758,7 +1758,7 @@ public class DATA
Id = DataType.BUILDING_Neurocyte,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 80, BuildTime = 60 })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 80, BuildTime = 60, ProducedBy = DataType.BUILDING_Neurocyte })
.AddPart(new EntityVanguardAddedModel
{ ReplaceId = DataType.UPGRADE_Offering, ImmortalId = DataType.IMMORTAL_Xol })
},
@ -1774,7 +1774,7 @@ public class DATA
})
.AddPart(new EntityHotkeyModel { Hotkey = "V", HotkeyGroup = "TAB", HoldSpace = false })
.AddPart(new EntityFactionModel { Faction = FactionType.Aru })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 125, BuildTime = 80 })
.AddPart(new EntityProductionModel { Alloy = 100, Ether = 125, BuildTime = 80, ProducedBy = DataType.BUILDING_RedVale })
.AddPart(new EntityRequirementModel
{
Id = DataType.BUILDING_RedVale,
@ -1800,7 +1800,7 @@ public class DATA
Id = DataType.BUILDING_RedVale,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 120, BuildTime = 80 })
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 120, BuildTime = 80, ProducedBy = DataType.BUILDING_RedVale })
.AddPart(new EntityVanguardReplacedModel
{ ImmortalId = DataType.IMMORTAL_Xol, ReplacedById = DataType.ABILITY_BirthingStorm })
},
@ -1815,7 +1815,7 @@ public class DATA
Id = DataType.BUILDING_RedVale,
Requirement = RequirementType.Research_Building
})
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 120, BuildTime = 80 })
.AddPart(new EntityProductionModel { Alloy = 75, Ether = 120, BuildTime = 80, ProducedBy = DataType.BUILDING_RedVale })
.AddPart(new EntityVanguardAddedModel
{ ImmortalId = DataType.IMMORTAL_Mala, ReplaceId = DataType.ABILITY_BloodPlague })
},
@ -2177,7 +2177,7 @@ public class DATA
Name = "Restore Lifeblood", Descriptive = DescriptiveType.Passive,
Description = @"Quickly heals a nearby unit"
})
.AddPart(new EntityProductionModel(){Cooldown = 0.25f})
.AddPart(new EntityProductionModel { Cooldown = 0.25f })
.AddPart(new EntityFactionModel { Faction = FactionType.Aru })
},
@ -2190,7 +2190,7 @@ public class DATA
Name = "Transfusion", Descriptive = DescriptiveType.Passive,
Description = @"Spends mana to refill the mana of nearby units"
})
.AddPart(new EntityProductionModel(){Energy = 4, Cooldown = 1})
.AddPart(new EntityProductionModel { Energy = 4, Cooldown = 1 })
.AddPart(new EntityFactionModel { Faction = FactionType.Aru })
},
{
@ -3000,7 +3000,6 @@ public class DATA
.AddPart(new EntityVitalityModel
{ Health = 350, DefenseLayer = 450, Armor = ArmorType.Heavy, IsStructure = true })
},
{
DataType.BUILDING_Reliquary,
new EntityModel(DataType.BUILDING_Reliquary, EntityType.Building)

14
Model/Entity/Parts/EntityProductionModel.cs

@ -1,22 +1,18 @@
namespace Model.Entity.Parts;
#nullable enable
namespace Model.Entity.Parts;
public class EntityProductionModel : IEntityPartInterface
{
public string Type { get; set; } = "EntityProductionModel";
public int Alloy { get; set; } = 0;
public int Ether { get; set; } = 0;
public int Pyre { get; set; } = 0;
public int Energy { get; set; } = 0;
public int DefensiveLayer { get; set; } = 0;
public int BuildTime { get; set; } = 0;
// Remove cooldown as a cost, and move into ability stats
public float Cooldown { get; set; } = 0;
public bool RequiresWorker { get; set; } = false;
public bool ConsumesWorker { get; set; } = false;
//public string ProductionType { get; set; }
public string? ProducedBy { get; set; } = null;
}

6
Model/Entity/Parts/EntityResearchCapacityModel.cs

@ -0,0 +1,6 @@
namespace Model.Entity.Parts;
public class EntityResearchCapacityModel : IEntityPartInterface
{
public int Slots { get; set; } = 16;
}

6
Model/Entity/Parts/EntityTrainingCapacityModel.cs

@ -0,0 +1,6 @@
namespace Model.Entity.Parts;
public class EntityTrainingCapacityModel : IEntityPartInterface
{
public int Slots { get; set; } = 16;
}

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>

10
Model/TravelTime.cs

@ -1,15 +1,13 @@
using System.ComponentModel.DataAnnotations;
namespace Model;
namespace Model;
public class TravelTime
{
public int Index { get; set; } = 0;
public int Value { get; set; } = 0;
public TravelTime(int index, int value)
{
Index = index;
Value = value;
}
public int Index { get; set; }
public int Value { get; set; }
}

4
Model/Variable.cs

@ -4,7 +4,7 @@ namespace Model;
public class Variable
{
[Key]
public string Key { get; set; } = "";
[Key] public string Key { get; set; } = "";
public string Value { get; set; } = "";
}

2
Services/IServices.cs

@ -305,7 +305,7 @@ public interface IBuildOrderService
public Dictionary<int, int> SupplyCountTimes { get; }
public bool Add(EntityModel entity, IEconomyService withEconomy, IToastService toastService);
public bool Add(EntityModel entity, IEconomyService withEconomy);
public void Add(EntityModel entity, int atInterval);
public bool AddWait(int forInterval);
public bool AddWaitTo(int interval);

123
Services/Immortal/BuildOrderService.cs

@ -12,11 +12,15 @@ namespace Services.Immortal;
public class BuildOrderService : IBuildOrderService
{
private BuildOrderModel buildOrder = new();
private readonly BuildOrderModel buildOrder = new();
private int lastInterval;
public BuildOrderService()
private readonly IToastService toastService;
public BuildOrderService(IToastService toastService)
{
this.toastService = toastService;
Reset();
}
@ -47,6 +51,7 @@ public class BuildOrderService : IBuildOrderService
OnChange -= action;
}
public void Add(EntityModel entity, int atInterval)
{
if (!buildOrder.StartedOrders.ContainsKey(atInterval))
@ -74,6 +79,16 @@ public class BuildOrderService : IBuildOrderService
else
buildOrder.UniqueCompletedCount[entity.DataType]++;
//entity.
if (!buildOrder.UniqueCompleted.ContainsKey(entity.DataType))
buildOrder.UniqueCompleted.Add(entity.DataType, new Dictionary<int, List<EntityModel>>());
if (!buildOrder.UniqueCompleted[entity.DataType].ContainsKey(completedTime))
buildOrder.UniqueCompleted[entity.DataType].Add(completedTime, new List<EntityModel>());
buildOrder.UniqueCompleted[entity.DataType][completedTime].Add(entity);
if (supply != null)
{
if (!supply.Takes.Equals(0)) buildOrder.CurrentSupplyUsed += supply.Takes;
@ -88,10 +103,11 @@ public class BuildOrderService : IBuildOrderService
public bool AddWait(int forInterval)
{
if (forInterval == 0)
if (forInterval < 0)
{
toastService.AddToast(new ToastModel(){SeverityType = SeverityType.Error, Title = "Wait", Message = "This should never happen."});
return false;
}
};
lastInterval += forInterval;
@ -107,7 +123,22 @@ public class BuildOrderService : IBuildOrderService
public bool AddWaitTo(int interval)
{
throw new NotImplementedException();
if (interval <= lastInterval)
{
toastService.AddToast(new ToastModel(){SeverityType = SeverityType.Error, Title = "Logic Error", Message = "You cannot wait to a time that has already elapsed."});
return false;
}
lastInterval = interval;
if (!buildOrder.StartedOrders.ContainsKey(lastInterval))
buildOrder.StartedOrders.Add(lastInterval, new List<EntityModel>());
if (!buildOrder.CompletedOrders.ContainsKey(lastInterval))
buildOrder.CompletedOrders.Add(lastInterval, new List<EntityModel>());
NotifyDataChanged();
return true;
}
public int? WillMeetRequirements(EntityModel entity)
@ -143,31 +174,14 @@ public class BuildOrderService : IBuildOrderService
return null;
}
public int? WillMeetTrainingQueue(EntityModel entity)
{
var supply = entity.Supply();
if (supply == null || supply.Takes.Equals(0)) return 0;
// TODO: Finish Training Queue Logic
foreach (var supplyAtTime in buildOrder.SupplyCountTimes)
if (supply.Takes + buildOrder.CurrentSupplyUsed < supplyAtTime.Key)
return supplyAtTime.Value;
return null;
}
public bool Add(EntityModel entity, IEconomyService withEconomy, IToastService withToasts)
public bool Add(EntityModel entity, IEconomyService withEconomy)
{
var atInterval = lastInterval;
if (!HandleSupply(entity, withToasts, ref atInterval)) return false;
if (!HandleRequirements(entity, withToasts, ref atInterval)) return false;
if (!HandleEconomy(entity, withEconomy, withToasts, ref atInterval)) return false;
if (!HandleSupply(entity, ref atInterval)) return false;
if (!HandleRequirements(entity, ref atInterval)) return false;
if (!HandleEconomy(entity, withEconomy, ref atInterval)) return false;
Add(entity, atInterval);
@ -214,6 +228,7 @@ public class BuildOrderService : IBuildOrderService
buildOrder.CurrentSupplyUsed -= entityRemoved.Supply()!.Takes;
buildOrder.UniqueCompletedCount[entityRemoved!.DataType]--;
if (buildOrder.UniqueCompletedCount[entityRemoved!.DataType] == 0)
UniqueCompletedTimes.Remove(entityRemoved.DataType);
@ -291,7 +306,6 @@ public class BuildOrderService : IBuildOrderService
public void DeprecatedSetColor(string color)
{
}
public string GetColor()
@ -306,10 +320,40 @@ public class BuildOrderService : IBuildOrderService
NotifyDataChanged();
}
public bool AddWaitTo(int interval, TimingService timingService)
{
if (lastInterval >= interval) return false;
if (interval > timingService.GetAttackTime()) return false;
if (!buildOrder.StartedOrders.ContainsKey(lastInterval))
buildOrder.StartedOrders.Add(lastInterval, new List<EntityModel>());
if (!buildOrder.CompletedOrders.ContainsKey(lastInterval))
buildOrder.CompletedOrders.Add(lastInterval, new List<EntityModel>());
NotifyDataChanged();
return true;
}
public int? WillMeetTrainingQueue(EntityModel entity)
{
var supply = entity.Supply();
if (supply == null || supply.Takes.Equals(0)) return 0;
foreach (var supplyAtTime in buildOrder.SupplyCountTimes)
if (supply.Takes + buildOrder.CurrentSupplyUsed < supplyAtTime.Key)
return supplyAtTime.Value;
return null;
}
private event Action OnChange = null!;
private bool HandleEconomy(EntityModel entity, IEconomyService withEconomy, IToastService withToasts,
ref int atInterval)
private bool HandleEconomy(EntityModel entity, IEconomyService withEconomy, ref int atInterval)
{
var production = entity.Production();
@ -318,8 +362,9 @@ public class BuildOrderService : IBuildOrderService
for (var interval = atInterval; interval < withEconomy.GetOverTime().Count; interval++)
{
var economyAtSecond = withEconomy.GetOverTime()[interval];
if (economyAtSecond.Alloy >= production.Alloy && economyAtSecond.Ether >= production.Ether &&
economyAtSecond.Pyre >= production.Pyre)
if (economyAtSecond.Alloy >= production.Alloy
&& economyAtSecond.Ether >= production.Ether
&& economyAtSecond.Pyre >= production.Pyre)
{
atInterval = interval;
@ -330,14 +375,14 @@ public class BuildOrderService : IBuildOrderService
}
if (withEconomy.GetOverTime().Last().Ether < production.Ether)
withToasts.AddToast(new ToastModel
toastService.AddToast(new ToastModel
{
Title = "Not Enough Ether", Message = "Build more ether extractors!",
SeverityType = SeverityType.Error
});
if (withEconomy.GetOverTime().Last().Alloy < production.Alloy)
withToasts.AddToast(new ToastModel
toastService.AddToast(new ToastModel
{
Title = "Not Enough Alloy", Message = "Build more bases!",
SeverityType = SeverityType.Error
@ -346,12 +391,12 @@ public class BuildOrderService : IBuildOrderService
return false;
}
private bool HandleSupply(EntityModel entity, IToastService withToasts, ref int atInterval)
private bool HandleSupply(EntityModel entity, ref int atInterval)
{
var minSupplyInterval = WillMeetSupply(entity);
if (minSupplyInterval == null)
{
withToasts.AddToast(new ToastModel
toastService.AddToast(new ToastModel
{
Title = "Supply Cap Reached", Message = "Build more supply!",
SeverityType = SeverityType.Error
@ -365,12 +410,12 @@ public class BuildOrderService : IBuildOrderService
return true;
}
private bool HandleTrainingQueue(EntityModel entity, IToastService withToasts, ref int atInterval)
private bool HandleTrainingQueue(EntityModel entity, ref int atInterval)
{
var minSupplyInterval = WillMeetSupply(entity);
if (minSupplyInterval == null)
{
withToasts.AddToast(new ToastModel
toastService.AddToast(new ToastModel
{
Title = "Supply Cap Reached", Message = "Build more supply!",
SeverityType = SeverityType.Error
@ -385,12 +430,12 @@ public class BuildOrderService : IBuildOrderService
}
private bool HandleRequirements(EntityModel entity, IToastService withToasts, ref int atInterval)
private bool HandleRequirements(EntityModel entity, ref int atInterval)
{
var minRequirementInterval = WillMeetRequirements(entity);
if (minRequirementInterval == null)
{
withToasts.AddToast(new ToastModel
toastService.AddToast(new ToastModel
{
Title = "Missing Requirements", Message = "You don't have what's needed for this unit.",
SeverityType = SeverityType.Error

1
Services/Immortal/DeprecatedBuildComparisionService.cs

@ -2,7 +2,6 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using Model.BuildOrders;
using Model.Entity;
using YamlDotNet.Serialization;
namespace Services.Immortal;

191
Services/Immortal/EconomyComparisonService.cs

@ -8,23 +8,98 @@ namespace Services.Immortal;
public class EconomyComparisionService : IEconomyComparisonService
{
public List<BuildToCompareModel> BuildsToCompare { get; set; }
private readonly int IntervalMax = 1024;
public EconomyComparisionService()
{
BuildsToCompare = new List<BuildToCompareModel>()
BuildsToCompare = new List<BuildToCompareModel>
{
new BuildToCompareModel { NumberOfTownHallExpansions = 0, Faction = DataType.FACTION_Aru, ChartColor = "green"},
new BuildToCompareModel { NumberOfTownHallExpansions = 0, Faction = DataType.FACTION_Aru, ChartColor = "red"}
new() { NumberOfTownHallExpansions = 0, Faction = DataType.FACTION_Aru, ChartColor = "green" },
new() { NumberOfTownHallExpansions = 0, Faction = DataType.FACTION_Aru, ChartColor = "red" }
};
BuildsToCompare[0].EconomyOverTimeModel = CalculateEconomy(BuildsToCompare[0], 0);
BuildsToCompare[1].EconomyOverTimeModel = CalculateEconomy(BuildsToCompare[1], 0);
BuildsToCompare[0].EconomyOverTimeModel = CalculateEconomy(BuildsToCompare[0]);
BuildsToCompare[1].EconomyOverTimeModel = CalculateEconomy(BuildsToCompare[1]);
}
public List<BuildToCompareModel> BuildsToCompare { get; set; }
public void ChangeNumberOfTownHalls(int forPlayer, int toCount)
{
if (BuildsToCompare[forPlayer].NumberOfTownHallExpansions == toCount) return;
BuildsToCompare[forPlayer].NumberOfTownHallExpansions = toCount;
CalculateBuildOrder(BuildsToCompare[forPlayer]);
NotifyDataChanged();
}
void CalculateBuildOrder(BuildToCompareModel buildToCompare)
public void ChangeTownHallTiming(int forPlayer, int forTownHall, int toTiming)
{
if (BuildsToCompare[forPlayer].TimeToBuildTownHall[forTownHall] == toTiming) return;
BuildsToCompare[forPlayer].TimeToBuildTownHall[forTownHall] = toTiming;
CalculateBuildOrder(BuildsToCompare[forPlayer]);
NotifyDataChanged();
}
public int GetTownHallCount(int forPlayer)
{
return BuildsToCompare[forPlayer].NumberOfTownHallExpansions;
}
public int GetTownHallBuildTime(int forPlayer, int forTownHall)
{
return BuildsToCompare[forPlayer].TimeToBuildTownHall[forTownHall];
}
public List<int> GetTownHallBuildTimes(int forPlayer)
{
return BuildsToCompare[forPlayer].TimeToBuildTownHall;
}
public void ChangeFaction(int forPlayer, string toFaction)
{
if (BuildsToCompare[forPlayer].Faction.Equals(toFaction)) return;
BuildsToCompare[forPlayer].Faction = toFaction;
NotifyDataChanged();
}
public string GetFaction(int forPlayer)
{
return BuildsToCompare[forPlayer].Faction;
}
public void ChangeColor(int forPlayer, string toColor)
{
if (BuildsToCompare[forPlayer].ChartColor.Equals(toColor)) return;
BuildsToCompare[forPlayer].ChartColor = toColor;
NotifyDataChanged();
}
public string GetColor(int forPlayer)
{
return BuildsToCompare[forPlayer].ChartColor;
}
public void Subscribe(Action action)
{
OnChange += action;
}
public void Unsubscribe(Action action)
{
OnChange -= action;
}
private void CalculateBuildOrder(BuildToCompareModel buildToCompare)
{
buildToCompare.BuildOrderModel = new BuildOrderModel(buildToCompare.Faction);
@ -36,15 +111,16 @@ public class EconomyComparisionService : IEconomyComparisonService
Add(townHall, buildToCompare, time);
Add(townHallMining2, buildToCompare, time + townHall.Production()!.BuildTime);
Add(townHallMining3, buildToCompare, time + townHall.Production()!.BuildTime + townHallMining2.Production()!.BuildTime);
Add(townHallMining3, buildToCompare,
time + townHall.Production()!.BuildTime + townHallMining2.Production()!.BuildTime);
}
CalculateEconomy(buildToCompare, 0);
CalculateEconomy(buildToCompare);
}
public void Add(EntityModel entityModel, BuildToCompareModel buildToCompare, int atInterval)
{
BuildOrderModel buildOrder = buildToCompare.BuildOrderModel;
var buildOrder = buildToCompare.BuildOrderModel;
if (!buildOrder.StartedOrders.ContainsKey(atInterval))
@ -64,17 +140,12 @@ public class EconomyComparisionService : IEconomyComparisonService
NotifyDataChanged();
}
private int IntervalMax = 1024;
private List<EconomyModel> CalculateEconomy(BuildToCompareModel buildToCompare, int fromInterval = 0)
{
// We don't consider things mining at zero seconds
if (fromInterval == 0)
{
fromInterval = 1;
}
if (fromInterval == 0) fromInterval = 1;
BuildOrderModel buildOrder = buildToCompare.BuildOrderModel;
var buildOrder = buildToCompare.BuildOrderModel;
List<EconomyModel> buildEconomyOverTime = buildToCompare.EconomyOverTimeModel;
@ -196,92 +267,6 @@ public class EconomyComparisionService : IEconomyComparisonService
}
public void ChangeNumberOfTownHalls(int forPlayer, int toCount)
{
if (BuildsToCompare[forPlayer].NumberOfTownHallExpansions == toCount)
{
return;
}
BuildsToCompare[forPlayer].NumberOfTownHallExpansions = toCount;
CalculateBuildOrder(BuildsToCompare[forPlayer]);
NotifyDataChanged();
}
public void ChangeTownHallTiming(int forPlayer, int forTownHall, int toTiming)
{
if (BuildsToCompare[forPlayer].TimeToBuildTownHall[forTownHall] == toTiming)
{
return;
}
BuildsToCompare[forPlayer].TimeToBuildTownHall[forTownHall] = toTiming;
CalculateBuildOrder(BuildsToCompare[forPlayer]);
NotifyDataChanged();
}
public int GetTownHallCount(int forPlayer)
{
return BuildsToCompare[forPlayer].NumberOfTownHallExpansions;
}
public int GetTownHallBuildTime(int forPlayer, int forTownHall)
{
return BuildsToCompare[forPlayer].TimeToBuildTownHall[forTownHall];
}
public List<int> GetTownHallBuildTimes(int forPlayer)
{
return BuildsToCompare[forPlayer].TimeToBuildTownHall;
}
public void ChangeFaction(int forPlayer, string toFaction)
{
if (BuildsToCompare[forPlayer].Faction.Equals(toFaction))
{
return;
}
BuildsToCompare[forPlayer].Faction = toFaction;
NotifyDataChanged();
}
public string GetFaction(int forPlayer)
{
return BuildsToCompare[forPlayer].Faction;
}
public void ChangeColor(int forPlayer, string toColor)
{
if (BuildsToCompare[forPlayer].ChartColor.Equals(toColor))
{
return;
}
BuildsToCompare[forPlayer].ChartColor = toColor;
NotifyDataChanged();
}
public string GetColor(int forPlayer)
{
return BuildsToCompare[forPlayer].ChartColor;
}
public void Subscribe(Action action)
{
OnChange += action;
}
public void Unsubscribe(Action action)
{
OnChange -= action;
}
private event Action OnChange = null!;
private void NotifyDataChanged()

36
Services/Immortal/EconomyService.cs

@ -1,5 +1,4 @@
using Model.BuildOrders;
using Model.Economy;
using Model.Economy;
using Model.Entity;
using Model.Types;
@ -29,10 +28,7 @@ public class EconomyService : IEconomyService
public void Calculate(IBuildOrderService buildOrder, ITimingService timing, int fromInterval)
{
// We don't consider things mining at zero seconds
if (fromInterval == 0)
{
fromInterval = 1;
}
if (fromInterval == 0) fromInterval = 1;
//TODO Break all this up
if (buildEconomyOverTime == null)
@ -44,7 +40,8 @@ public class EconomyService : IEconomyService
if (buildEconomyOverTime.Count > timing.GetAttackTime())
buildEconomyOverTime.RemoveRange(timing.GetAttackTime(), buildEconomyOverTime.Count - timing.GetAttackTime());
buildEconomyOverTime.RemoveRange(timing.GetAttackTime(),
buildEconomyOverTime.Count - timing.GetAttackTime());
while (buildEconomyOverTime.Count < timing.GetAttackTime())
buildEconomyOverTime.Add(new EconomyModel { Interval = buildEconomyOverTime.Count - 1 });
@ -70,6 +67,14 @@ public class EconomyService : IEconomyService
NotifyDataChanged();
}
public EconomyModel GetEconomy(int atInterval)
{
if (atInterval >= buildEconomyOverTime.Count) return buildEconomyOverTime.Last();
return buildEconomyOverTime[atInterval];
}
private static void SetupCurrentInverval(IBuildOrderService buildOrder, EconomyModel economyAtSecond, int interval)
{
economyAtSecond.Interval = interval;
@ -129,7 +134,7 @@ public class EconomyService : IEconomyService
*/
private static int CalculateCreatingWorkerCosts(EconomyModel economyAtSecond)
{
int createdWorkers = 0;
var createdWorkers = 0;
if (economyAtSecond.CreatingWorkerCount > 0)
for (var i = 0; i < economyAtSecond.CreatingWorkerDelays.Count; i++)
@ -158,7 +163,7 @@ public class EconomyService : IEconomyService
*/
private static int AddFundsFromHarvestPoints(EconomyModel economyAtSecond, float freeWorkers)
{
int workersNeeded = 0;
var workersNeeded = 0;
foreach (var entity in economyAtSecond.HarvestPoints)
{
@ -188,10 +193,7 @@ public class EconomyService : IEconomyService
private static void AddPassivePyreGain(int interval, EconomyModel economyAtSecond)
{
if (interval % 3 == 0)
{
economyAtSecond.Pyre += 1;
}
if (interval % 3 == 0) economyAtSecond.Pyre += 1;
}
private void CarryOverEconomyFromPreviousInterval(int interval, EconomyModel economyAtSecond)
@ -210,14 +212,6 @@ public class EconomyService : IEconomyService
}
public EconomyModel GetEconomy(int atInterval)
{
if (atInterval >= buildEconomyOverTime.Count) return buildEconomyOverTime.Last();
return buildEconomyOverTime[atInterval];
}
private event Action OnChange = null!;
private void NotifyDataChanged()

4
Services/Services.csproj

@ -15,11 +15,11 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="YamlDotNet" Version="11.2.1" />
<PackageReference Include="YamlDotNet" Version="11.2.1"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Model\Model.csproj" />
<ProjectReference Include="..\Model\Model.csproj"/>
</ItemGroup>
</Project>

4
Services/Website/SearchService.cs

@ -6,13 +6,13 @@ namespace Services.Website;
public class SearchService : ISearchService
{
private readonly IDocumentationService documentationService;
private bool isLoaded;
private readonly INoteService noteService;
private readonly IWebsiteService websiteService;
private bool isLoaded;
public SearchService(IWebsiteService websiteService, INoteService noteService,
IDocumentationService documentationService)
{

6
Services/Website/VariableService.cs

@ -29,12 +29,8 @@ public class VariableService : IVariableService
var variables = (await httpClient.GetFromJsonAsync<Variable[]>("generated/Variables.json"))!
.ToList();
foreach (var variable in variables)
{
Variables.Add(variable.Key, variable.Value);
}
foreach (var variable in variables) Variables.Add(variable.Key, variable.Value);
isLoaded = true;
}
}
Loading…
Cancel
Save