diff --git a/Components/Form/FormTextComponent.razor b/Components/Form/FormTextComponent.razor index aa43c82..9f960e8 100644 --- a/Components/Form/FormTextComponent.razor +++ b/Components/Form/FormTextComponent.razor @@ -54,7 +54,7 @@ [Parameter] public string Id { get; set; } = ""; - + [Parameter] public string Label { get; set; } = ""; @@ -67,10 +67,10 @@ [Parameter] public EventCallback OnInput { get; set; } - + [Parameter] public EventCallback OnChange { get; set; } - + [Parameter] public EventCallback OnFocus { get; set; } diff --git a/IGP/Pages/BuildCalculator/BuildCalculatorPage.razor b/IGP/Pages/BuildCalculator/BuildCalculatorPage.razor index e7c32df..1cbc022 100644 --- a/IGP/Pages/BuildCalculator/BuildCalculatorPage.razor +++ b/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()); } diff --git a/IGP/Pages/BuildCalculator/Parts/HotkeyViewerComponent.razor b/IGP/Pages/BuildCalculator/Parts/HotkeyViewerComponent.razor index 39bd341..023484b 100644 --- a/IGP/Pages/BuildCalculator/Parts/HotkeyViewerComponent.razor +++ b/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()); } diff --git a/IGP/Pages/BuildCalculator/Parts/OptionsComponent.razor b/IGP/Pages/BuildCalculator/Parts/OptionsComponent.razor index 170a910..bc2247b 100644 --- a/IGP/Pages/BuildCalculator/Parts/OptionsComponent.razor +++ b/IGP/Pages/BuildCalculator/Parts/OptionsComponent.razor @@ -13,11 +13,10 @@ Building Input Delay Add a input delay to constructing buildings for simulating worker movement and player micro. -
Wait Time @@ -25,15 +24,14 @@ Add Wait - + Wait To - Add Wait + Add Wait -
@@ -45,8 +43,8 @@ @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) @@ -58,18 +56,23 @@ { WaitTime = (int)changeEventArgs.Value!; } + + void OnWaitToChanged(ChangeEventArgs changeEventArgs) + { + WaitTo = (int)changeEventArgs.Value!; + } - public void OnWaitClicked() + private void OnWaitClicked() { if (buildOrderService.AddWait(WaitTime)) { economyService.Calculate(buildOrderService, timingService, buildOrderService.GetLastRequestInterval()); } } - - public void OnWaitToClicked() + + private void OnWaitToClicked() { - if (buildOrderService.AddWait(WaitTime)) + if (buildOrderService.AddWaitTo(WaitTo)) { economyService.Calculate(buildOrderService, timingService, buildOrderService.GetLastRequestInterval()); } diff --git a/IGP/Pages/Comparision/ComparisionPage.razor b/IGP/Pages/Comparision/ComparisionPage.razor index 12745ed..086984c 100644 --- a/IGP/Pages/Comparision/ComparisionPage.razor +++ b/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()); } diff --git a/IGP_Convert/Program.cs b/IGP_Convert/Program.cs index 34aa194..7537b2a 100644 --- a/IGP_Convert/Program.cs +++ b/IGP_Convert/Program.cs @@ -27,6 +27,6 @@ using (var db = new DatabaseContext(options.Options)) File.WriteAllTextAsync($"{webPath}/NoteContentModels.json", JsonSerializer.Serialize(db.NoteContentModels)); File.WriteAllTextAsync($"{webPath}/NoteConnectionModels.json", JsonSerializer.Serialize(db.NoteConnectionModels)); File.WriteAllTextAsync($"{webPath}/NoteSectionModels.json", JsonSerializer.Serialize(db.NoteSectionModels)); - + File.WriteAllTextAsync($"{webPath}/Variables.json", JsonSerializer.Serialize(db.Variables)); } \ No newline at end of file diff --git a/Model/BuildOrders/BuildOrderModel.cs b/Model/BuildOrders/BuildOrderModel.cs index 4823102..f6c0c30 100644 --- a/Model/BuildOrders/BuildOrderModel.cs +++ b/Model/BuildOrders/BuildOrderModel.cs @@ -17,7 +17,7 @@ public class BuildOrderModel { Initialize(factionType); } - + public string Name { get; set; } = ""; public string Notes { get; set; } = @""; @@ -28,19 +28,18 @@ public class BuildOrderModel public Dictionary UniqueCompletedTimes { get; set; } = new(); public Dictionary UniqueCompletedCount { get; set; } = new(); public Dictionary SupplyCountTimes { get; set; } = new(); + + public Dictionary>> UniqueCompleted { get; set; } = new(); - public List TrainingCapacityModels { get; set; } = new(); + public List 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> { { diff --git a/Model/BuildOrders/BuildToCompareModel.cs b/Model/BuildOrders/BuildToCompareModel.cs index f810cc1..9502806 100644 --- a/Model/BuildOrders/BuildToCompareModel.cs +++ b/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; @@ -8,22 +7,25 @@ using Model.Entity.Data; 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,22 +35,18 @@ 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 TimeToBuildTownHall { get; set; } = new(); - + public List EconomyOverTimeModel { get; set; } = new(); - + public BuildOrderModel BuildOrderModel { get; set; } = new(); - + public string ChartColor { get; set; } } \ No newline at end of file diff --git a/Model/BuildOrders/ResearchSlot.cs b/Model/BuildOrders/ResearchSlot.cs new file mode 100644 index 0000000..3380370 --- /dev/null +++ b/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; +} \ No newline at end of file diff --git a/Model/BuildOrders/TrainingCapacityUsedModel.cs b/Model/BuildOrders/TrainingCapacityUsedModel.cs index 44fec99..3e60d73 100644 --- a/Model/BuildOrders/TrainingCapacityUsedModel.cs +++ b/Model/BuildOrders/TrainingCapacityUsedModel.cs @@ -1,6 +1,4 @@ - - -using Model.Entity.Data; +using Model.Entity.Data; namespace Model.BuildOrders; diff --git a/Model/BuildOrders/TrainingSlot.cs b/Model/BuildOrders/TrainingSlot.cs new file mode 100644 index 0000000..e6ed26d --- /dev/null +++ b/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; +} \ No newline at end of file diff --git a/Model/Economy/EconomyOverTimeModel.cs b/Model/Economy/EconomyOverTimeModel.cs index 1f524d7..e51ef97 100644 --- a/Model/Economy/EconomyOverTimeModel.cs +++ b/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; diff --git a/Model/Entity/Data/DATA.cs b/Model/Entity/Data/DATA.cs index dcec87e..5f4391d 100644 --- a/Model/Entity/Data/DATA.cs +++ b/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 Hallowed Ground." + @"Melee Warrior (Ground Unit) - Front-line warriors enhanced by Hallowed Ground." }) .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) diff --git a/Model/Entity/Parts/EntityProductionModel.cs b/Model/Entity/Parts/EntityProductionModel.cs index 200e877..713d7ae 100644 --- a/Model/Entity/Parts/EntityProductionModel.cs +++ b/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; } \ No newline at end of file diff --git a/Model/Entity/Parts/EntityResearchCapacityModel.cs b/Model/Entity/Parts/EntityResearchCapacityModel.cs new file mode 100644 index 0000000..5903d03 --- /dev/null +++ b/Model/Entity/Parts/EntityResearchCapacityModel.cs @@ -0,0 +1,6 @@ +namespace Model.Entity.Parts; + +public class EntityResearchCapacityModel : IEntityPartInterface +{ + public int Slots { get; set; } = 16; +} \ No newline at end of file diff --git a/Model/Entity/Parts/EntityTrainingCapacityModel.cs b/Model/Entity/Parts/EntityTrainingCapacityModel.cs new file mode 100644 index 0000000..6e0b7fc --- /dev/null +++ b/Model/Entity/Parts/EntityTrainingCapacityModel.cs @@ -0,0 +1,6 @@ +namespace Model.Entity.Parts; + +public class EntityTrainingCapacityModel : IEntityPartInterface +{ + public int Slots { get; set; } = 16; +} \ No newline at end of file diff --git a/Model/Model.csproj b/Model/Model.csproj index ccf37ca..21841e5 100644 --- a/Model/Model.csproj +++ b/Model/Model.csproj @@ -4,7 +4,7 @@ net7.0 - - + + diff --git a/Model/TravelTime.cs b/Model/TravelTime.cs index c8128e6..ceea696 100644 --- a/Model/TravelTime.cs +++ b/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; } } \ No newline at end of file diff --git a/Model/Variable.cs b/Model/Variable.cs index 9b49653..70617a1 100644 --- a/Model/Variable.cs +++ b/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; } = ""; } \ No newline at end of file diff --git a/Services/IServices.cs b/Services/IServices.cs index 8990e81..6787d8f 100644 --- a/Services/IServices.cs +++ b/Services/IServices.cs @@ -45,7 +45,7 @@ public interface ISearchService void Hide(); } -public interface IVariableService +public interface IVariableService { public Dictionary Variables { get; set; } public Task Load(); @@ -59,7 +59,7 @@ public interface IEconomyComparisonService public void ChangeTownHallTiming(int forPlayer, int forTownHall, int toTiming); public int GetTownHallCount(int forPlayer); public int GetTownHallBuildTime(int forPlayer, int forTownHall); - + public List GetTownHallBuildTimes(int forPlayer); public void ChangeFaction(int forPlayer, string toFaction); public string GetFaction(int forPlayer); @@ -305,12 +305,12 @@ public interface IBuildOrderService public Dictionary 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); - + public void SetName(string name); public string GetName(); diff --git a/Services/Immortal/BuildOrderService.cs b/Services/Immortal/BuildOrderService.cs index 0801ae5..70a8a37 100644 --- a/Services/Immortal/BuildOrderService.cs +++ b/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,13 +79,23 @@ public class BuildOrderService : IBuildOrderService else buildOrder.UniqueCompletedCount[entity.DataType]++; + //entity. + if (!buildOrder.UniqueCompleted.ContainsKey(entity.DataType)) + buildOrder.UniqueCompleted.Add(entity.DataType, new Dictionary>()); + + if (!buildOrder.UniqueCompleted[entity.DataType].ContainsKey(completedTime)) + buildOrder.UniqueCompleted[entity.DataType].Add(completedTime, new List()); + + buildOrder.UniqueCompleted[entity.DataType][completedTime].Add(entity); + + if (supply != null) { if (!supply.Takes.Equals(0)) buildOrder.CurrentSupplyUsed += supply.Takes; if (!supply.Grants.Equals(0)) buildOrder.SupplyCountTimes.Add(buildOrder.SupplyCountTimes.Last().Key + supply.Grants, completedTime); } - + if (atInterval > lastInterval) lastInterval = atInterval; NotifyDataChanged(); @@ -88,28 +103,44 @@ 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; - + if (!buildOrder.StartedOrders.ContainsKey(lastInterval)) buildOrder.StartedOrders.Add(lastInterval, new List()); if (!buildOrder.CompletedOrders.ContainsKey(lastInterval)) buildOrder.CompletedOrders.Add(lastInterval, new List()); - + NotifyDataChanged(); return true; } 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()); + + if (!buildOrder.CompletedOrders.ContainsKey(lastInterval)) + buildOrder.CompletedOrders.Add(lastInterval, new List()); + + NotifyDataChanged(); + return true; } - + public int? WillMeetRequirements(EntityModel entity) { var requirements = entity.Requirements(); @@ -142,32 +173,15 @@ 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); @@ -186,7 +200,7 @@ public class BuildOrderService : IBuildOrderService lastInterval = buildOrder.StartedOrders.Last().Key; return; } - + var lastStarted = buildOrder.StartedOrders.Keys.Last(); var lastCompleted = buildOrder.CompletedOrders.Keys.Last(); @@ -212,7 +226,8 @@ public class BuildOrderService : IBuildOrderService if (entityRemoved.Supply()?.Takes > 0) buildOrder.CurrentSupplyUsed -= entityRemoved.Supply()!.Takes; - + + buildOrder.UniqueCompletedCount[entityRemoved!.DataType]--; if (buildOrder.UniqueCompletedCount[entityRemoved!.DataType] == 0) @@ -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()); + + if (!buildOrder.CompletedOrders.ContainsKey(lastInterval)) + buildOrder.CompletedOrders.Add(lastInterval, new List()); + + 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 @@ -384,13 +429,13 @@ public class BuildOrderService : IBuildOrderService return true; } - - 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 diff --git a/Services/Immortal/DeprecatedBuildComparisionService.cs b/Services/Immortal/DeprecatedBuildComparisionService.cs index 45ae6d8..034a825 100644 --- a/Services/Immortal/DeprecatedBuildComparisionService.cs +++ b/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; diff --git a/Services/Immortal/EconomyComparisonService.cs b/Services/Immortal/EconomyComparisonService.cs index 6b2a959..2b92b9e 100644 --- a/Services/Immortal/EconomyComparisonService.cs +++ b/Services/Immortal/EconomyComparisonService.cs @@ -8,23 +8,98 @@ namespace Services.Immortal; public class EconomyComparisionService : IEconomyComparisonService { - public List BuildsToCompare { get; set; } + private readonly int IntervalMax = 1024; public EconomyComparisionService() { - BuildsToCompare = new List() + BuildsToCompare = new List { - 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 BuildsToCompare { get; set; } + + + 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 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; + } - void CalculateBuildOrder(BuildToCompareModel buildToCompare) + private void CalculateBuildOrder(BuildToCompareModel buildToCompare) { buildToCompare.BuildOrderModel = new BuildOrderModel(buildToCompare.Faction); @@ -36,22 +111,23 @@ 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)) buildOrder.StartedOrders.Add(atInterval, new List()); var production = entityModel.Production(); - + var completedTime = atInterval; if (production != null) completedTime += production.BuildTime; @@ -64,17 +140,12 @@ public class EconomyComparisionService : IEconomyComparisonService NotifyDataChanged(); } - private int IntervalMax = 1024; - private List CalculateEconomy(BuildToCompareModel buildToCompare, int fromInterval = 0) { // We don't consider things mining at zero seconds - if (fromInterval == 0) - { - fromInterval = 1; - } - - BuildOrderModel buildOrder = buildToCompare.BuildOrderModel; + if (fromInterval == 0) fromInterval = 1; + + var buildOrder = buildToCompare.BuildOrderModel; List buildEconomyOverTime = buildToCompare.EconomyOverTimeModel; @@ -195,93 +266,7 @@ public class EconomyComparisionService : IEconomyComparisonService return buildEconomyOverTime; } - - 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 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() diff --git a/Services/Immortal/EconomyService.cs b/Services/Immortal/EconomyService.cs index 1b330bc..af9d36f 100644 --- a/Services/Immortal/EconomyService.cs +++ b/Services/Immortal/EconomyService.cs @@ -1,5 +1,4 @@ -using Model.BuildOrders; -using Model.Economy; +using Model.Economy; using Model.Entity; using Model.Types; @@ -8,7 +7,7 @@ namespace Services.Immortal; public class EconomyService : IEconomyService { private List buildEconomyOverTime = null!; - + private Dictionary> specficEconomiesOverTime = null!; public List GetOverTime() @@ -29,11 +28,8 @@ 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 }); @@ -52,14 +49,14 @@ public class EconomyService : IEconomyService for (var interval = fromInterval; interval < timing.GetAttackTime(); interval++) { buildEconomyOverTime[interval] = new EconomyModel(); - + var economyAtSecond = buildEconomyOverTime[interval]; - + CarryOverEconomyFromPreviousInterval(interval, economyAtSecond); SetupCurrentInverval(buildOrder, economyAtSecond, interval); AddPassivePyreGain(interval, economyAtSecond); - float freeWorkers = economyAtSecond.WorkerCount - economyAtSecond.BusyWorkerCount; + float freeWorkers = economyAtSecond.WorkerCount - economyAtSecond.BusyWorkerCount; var workersNeeded = AddFundsFromHarvestPoints(economyAtSecond, freeWorkers); workersNeeded -= CalculateCreatingWorkerCosts(economyAtSecond); MakeNeededNewWorkersRequests(workersNeeded, economyAtSecond); @@ -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,8 +134,8 @@ 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++) if (economyAtSecond.CreatingWorkerDelays[i] > 0) @@ -158,8 +163,8 @@ public class EconomyService : IEconomyService */ private static int AddFundsFromHarvestPoints(EconomyModel economyAtSecond, float freeWorkers) { - int workersNeeded = 0; - + var workersNeeded = 0; + foreach (var entity in economyAtSecond.HarvestPoints) { var harvester = entity.Harvest(); @@ -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() diff --git a/Services/Services.csproj b/Services/Services.csproj index 31e5733..5ced067 100644 --- a/Services/Services.csproj +++ b/Services/Services.csproj @@ -15,11 +15,11 @@ - + - + diff --git a/Services/Website/SearchService.cs b/Services/Website/SearchService.cs index 8d34e64..c23db09 100644 --- a/Services/Website/SearchService.cs +++ b/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) { diff --git a/Services/Website/VariableService.cs b/Services/Website/VariableService.cs index 4794208..fea4fb7 100644 --- a/Services/Website/VariableService.cs +++ b/Services/Website/VariableService.cs @@ -29,12 +29,8 @@ public class VariableService : IVariableService var variables = (await httpClient.GetFromJsonAsync("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; } - } \ No newline at end of file