From adbf36da9ff45aaa7e70eb113acb0ee80bed05ea Mon Sep 17 00:00:00 2001 From: Jonathan McCaffrey Date: Sun, 24 Apr 2022 21:34:02 -0400 Subject: [PATCH] feat(Storage) Storage feature done --- Components/Feedback/ToastComponent.razor | 2 +- IGP/Dialog/EntityDialogComponent.razor | 2 +- IGP/Dialog/SearchDialogComponent.razor | 2 +- IGP/Index.razor | 2 +- .../BuildCalculator/BuildCalculatorPage.razor | 4 +- .../Parts/EntityClickViewComponent.razor | 4 +- .../Parts/FilterComponent.razor | 34 +- .../Parts/HotkeyViewerComponent.razor | 12 +- .../Parts/OptionsComponent.razor | 58 ++- .../Parts/TimingComponent.razor | 11 + IGP/Pages/Comparision/ComparisionPage.razor | 4 +- IGP/Pages/Database/DatabasePage.razor | 8 +- .../Parts/EntityFilterComponent.razor | 8 +- .../DocumentationIndexPage.razor | 2 +- .../Documentation/DocumentationPage.razor | 2 +- IGP/Pages/Notes/NotesIndexPage.razor | 2 +- IGP/Pages/Notes/NotesPage.razor | 2 +- IGP/Pages/PermissionsPage.razor | 2 +- IGP/Pages/StoragePage.razor | 161 ++++++++- IGP/Portals/EntityDialogPortal.razor | 2 +- IGP/Portals/SearchPortal.razor | 2 +- IGP/Portals/ToastPortal.razor | 2 +- Model/Entity/Data/DATA.cs | 342 +++++++++--------- Model/Entity/Data/Ids_Entity.cs | 5 + Model/Entity/Parts/EntityFactionModel.cs | 5 +- Model/Entity/Types/FactionType.cs | 14 - Model/Entity/Types/ImmortalType.cs | 7 - Model/Model.csproj | 4 +- Services/IServices.cs | 20 +- Services/Immortal/BuildOrderService.cs | 53 +-- Services/Immortal/EntityDisplayService.cs | 14 +- Services/Immortal/EntityFilterService.cs | 24 +- Services/Immortal/ImmortalSelectionService.cs | 54 ++- Services/Immortal/TimingService.cs | 48 ++- Services/Services.csproj | 10 +- Services/Website/PermissionService.cs | 11 +- Services/Website/StorageService.cs | 49 ++- 37 files changed, 620 insertions(+), 368 deletions(-) delete mode 100644 Model/Entity/Types/FactionType.cs delete mode 100644 Model/Entity/Types/ImmortalType.cs diff --git a/Components/Feedback/ToastComponent.razor b/Components/Feedback/ToastComponent.razor index 2bc4a33..3150eff 100644 --- a/Components/Feedback/ToastComponent.razor +++ b/Components/Feedback/ToastComponent.razor @@ -84,7 +84,7 @@ else toastService.RemoveToast(Toast!); } - public void Dispose() + void IDisposable.Dispose() { toastService.Unsubscribe(OnUpdate); } diff --git a/IGP/Dialog/EntityDialogComponent.razor b/IGP/Dialog/EntityDialogComponent.razor index 371ae5e..39d4cf3 100644 --- a/IGP/Dialog/EntityDialogComponent.razor +++ b/IGP/Dialog/EntityDialogComponent.razor @@ -150,7 +150,7 @@ entityDialogService.Subscribe(OnUpdate); } - public void Dispose() + void IDisposable.Dispose() { entityDialogService.Unsubscribe(OnUpdate); } diff --git a/IGP/Dialog/SearchDialogComponent.razor b/IGP/Dialog/SearchDialogComponent.razor index 08c50bb..baeff94 100644 --- a/IGP/Dialog/SearchDialogComponent.razor +++ b/IGP/Dialog/SearchDialogComponent.razor @@ -144,7 +144,7 @@ StateHasChanged(); } - public void Dispose() + void IDisposable.Dispose() { searchService.Unsubscribe(OnSearchChanged); timer.Elapsed -= FocusTimer; diff --git a/IGP/Index.razor b/IGP/Index.razor index e31ab73..4e94a39 100644 --- a/IGP/Index.razor +++ b/IGP/Index.razor @@ -3,7 +3,7 @@ @layout PageLayout - + \ No newline at end of file diff --git a/IGP/Pages/BuildCalculator/BuildCalculatorPage.razor b/IGP/Pages/BuildCalculator/BuildCalculatorPage.razor index d01133d..3d96608 100644 --- a/IGP/Pages/BuildCalculator/BuildCalculatorPage.razor +++ b/IGP/Pages/BuildCalculator/BuildCalculatorPage.razor @@ -257,8 +257,8 @@ var hotkeyGroup = keyService.GetHotkeyGroup(); var isHoldSpace = keyService.IsHoldingSpace(); - var faction = filterService.GetFactionType(); - var immortal = filterService.GetImmortalType(); + var faction = filterService.GetFaction(); + var immortal = filterService.GetImmortal(); var entity = EntityModel.GetFrom(hotkey!, hotkeyGroup, isHoldSpace, faction, immortal); diff --git a/IGP/Pages/BuildCalculator/Parts/EntityClickViewComponent.razor b/IGP/Pages/BuildCalculator/Parts/EntityClickViewComponent.razor index 8edf26e..5cc0628 100644 --- a/IGP/Pages/BuildCalculator/Parts/EntityClickViewComponent.razor +++ b/IGP/Pages/BuildCalculator/Parts/EntityClickViewComponent.razor @@ -68,8 +68,8 @@ var hotkey = KeyService.GetHotkey(); var hotkeyGroup = KeyService.GetHotkeyGroup(); var isHoldSpace = KeyService.IsHoldingSpace(); - var faction = FilterService.GetFactionType(); - var immortal = FilterService.GetImmortalType(); + var faction = FilterService.GetFaction(); + var immortal = FilterService.GetImmortal(); var foundEntity = EntityModel.GetFrom(hotkey!, hotkeyGroup, isHoldSpace, faction, immortal); diff --git a/IGP/Pages/BuildCalculator/Parts/FilterComponent.razor b/IGP/Pages/BuildCalculator/Parts/FilterComponent.razor index 406e2bd..4dadb95 100644 --- a/IGP/Pages/BuildCalculator/Parts/FilterComponent.razor +++ b/IGP/Pages/BuildCalculator/Parts/FilterComponent.razor @@ -1,27 +1,33 @@ -@inject IJSRuntime jsRuntime; -@inject IImmortalSelectionService filterService +@inject IJSRuntime JsRuntime; +@inject IImmortalSelectionService FilterService Faction - - + + Immortal - @if (filterService.GetFactionType() == FactionType.QRath) + @if (FilterService.GetFaction() == DataType.FACTION_QRath) { - - + + } - @if (filterService.GetFactionType() == FactionType.Aru) + @if (FilterService.GetFaction() == DataType.FACTION_Aru) { - - + + } @@ -31,18 +37,18 @@ void OnFactionChanged(ChangeEventArgs e) { - filterService.SelectFactionType(e.Value!.ToString()!); + FilterService.SelectFaction(e.Value!.ToString()!); } void OnImmortalChanged(ChangeEventArgs e) { - filterService.SelectImmortalType(e.Value!.ToString()!); + FilterService.SelectImmortal(e.Value!.ToString()!); } protected override bool ShouldRender() { #if DEBUG - jsRuntime.InvokeVoidAsync("console.time", "FilterComponent"); + JsRuntime.InvokeVoidAsync("console.time", "FilterComponent"); #endif return true; @@ -51,7 +57,7 @@ protected override void OnAfterRender(bool firstRender) { #if DEBUG - jsRuntime.InvokeVoidAsync("console.timeEnd", "FilterComponent"); + JsRuntime.InvokeVoidAsync("console.timeEnd", "FilterComponent"); #endif } diff --git a/IGP/Pages/BuildCalculator/Parts/HotkeyViewerComponent.razor b/IGP/Pages/BuildCalculator/Parts/HotkeyViewerComponent.razor index 023484b..8aaa580 100644 --- a/IGP/Pages/BuildCalculator/Parts/HotkeyViewerComponent.razor +++ b/IGP/Pages/BuildCalculator/Parts/HotkeyViewerComponent.razor @@ -164,7 +164,7 @@ // Move to Filter Service bool InvalidFaction(EntityModel entity) { - if (entity.Faction() != null && entity.Faction()?.Faction != filterService.GetFactionType() && filterService.GetFactionType() != FactionType.Any) + if (entity.Faction() != null && entity.Faction()?.Faction != filterService.GetFaction() && filterService.GetFaction() != DataType.Any) { return true; } @@ -176,8 +176,8 @@ bool InvalidVanguard(EntityModel entity) { if (entity.VanguardAdded() != null - && entity.VanguardAdded()?.ImmortalId != filterService.GetImmortalType() - && filterService.GetImmortalType() != ImmortalType.Any) + && entity.VanguardAdded()?.ImmortalId != filterService.GetImmortal() + && filterService.GetImmortal() != DataType.Any) { return true; } @@ -192,7 +192,7 @@ { foreach (var replaced in entity.Replaceds()) { - if (filterService.GetImmortalType() == replaced.ImmortalId) + if (filterService.GetImmortal() == replaced.ImmortalId) { return true; } @@ -319,8 +319,8 @@ var hotkeyGroup = keyService.GetHotkeyGroup(); var isHoldSpace = keyService.IsHoldingSpace(); - var faction = filterService.GetFactionType(); - var immortal = filterService.GetImmortalType(); + var faction = filterService.GetFaction(); + var immortal = filterService.GetImmortal(); var entity = EntityModel.GetFrom(hotkey!, hotkeyGroup, isHoldSpace, faction, immortal); diff --git a/IGP/Pages/BuildCalculator/Parts/OptionsComponent.razor b/IGP/Pages/BuildCalculator/Parts/OptionsComponent.razor index bc2247b..3ca58ba 100644 --- a/IGP/Pages/BuildCalculator/Parts/OptionsComponent.razor +++ b/IGP/Pages/BuildCalculator/Parts/OptionsComponent.razor @@ -1,14 +1,17 @@ -@inject IJSRuntime jsRuntime; +@inject IJSRuntime JsRuntime; -@inject IBuildOrderService buildOrderService -@inject IEconomyService economyService -@inject IToastService toastService -@inject ITimingService timingService +@inject IBuildOrderService BuildOrderService +@inject IEconomyService EconomyService +@inject IToastService ToastService +@inject ITimingService TimingService + +@using System.Data +@implements IDisposable Building Input Delay Add a input delay to constructing buildings for simulating worker movement and player micro. @@ -17,7 +20,7 @@ Wait Time @@ -26,7 +29,7 @@ Wait To @@ -43,45 +46,69 @@ @code { + private int BuildDelay { get; set; } = 2; private int WaitTime { get; set; } = 30; private int WaitTo { get; set; } = 30; + protected override void OnInitialized() + { + TimingService.Subscribe(RefreshDefaults); + + RefreshDefaults(); + } + void IDisposable.Dispose() + { + TimingService.Unsubscribe(RefreshDefaults); + } + + void RefreshDefaults() + { + BuildDelay = TimingService.BuildingInputDelay; + WaitTime = TimingService.WaitTime; + WaitTo = TimingService.WaitTo; + + StateHasChanged(); + + } + void OnBuildingInputDelayChanged(ChangeEventArgs changeEventArgs) { - buildOrderService.BuildingInputDelay = int.Parse(changeEventArgs.Value!.ToString()!); + TimingService.BuildingInputDelay = int.Parse(changeEventArgs.Value!.ToString()!); } void OnWaitTimeChanged(ChangeEventArgs changeEventArgs) { + TimingService.WaitTime = (int)changeEventArgs.Value!; WaitTime = (int)changeEventArgs.Value!; } void OnWaitToChanged(ChangeEventArgs changeEventArgs) { + TimingService.WaitTo = (int)changeEventArgs.Value!; WaitTo = (int)changeEventArgs.Value!; } private void OnWaitClicked() { - if (buildOrderService.AddWait(WaitTime)) + if (BuildOrderService.AddWait(WaitTime)) { - economyService.Calculate(buildOrderService, timingService, buildOrderService.GetLastRequestInterval()); + EconomyService.Calculate(BuildOrderService, TimingService, BuildOrderService.GetLastRequestInterval()); } } private void OnWaitToClicked() { - if (buildOrderService.AddWaitTo(WaitTo)) + if (BuildOrderService.AddWaitTo(WaitTo)) { - economyService.Calculate(buildOrderService, timingService, buildOrderService.GetLastRequestInterval()); + EconomyService.Calculate(BuildOrderService, TimingService, BuildOrderService.GetLastRequestInterval()); } } protected override bool ShouldRender() { #if DEBUG - jsRuntime.InvokeVoidAsync("console.time", "TimingComponent"); + JsRuntime.InvokeVoidAsync("console.time", "TimingComponent"); #endif return true; @@ -90,9 +117,8 @@ protected override void OnAfterRender(bool firstRender) { #if DEBUG - jsRuntime.InvokeVoidAsync("console.timeEnd", "TimingComponent"); + JsRuntime.InvokeVoidAsync("console.timeEnd", "TimingComponent"); #endif } - } \ No newline at end of file diff --git a/IGP/Pages/BuildCalculator/Parts/TimingComponent.razor b/IGP/Pages/BuildCalculator/Parts/TimingComponent.razor index 9c694a1..9cdab07 100644 --- a/IGP/Pages/BuildCalculator/Parts/TimingComponent.razor +++ b/IGP/Pages/BuildCalculator/Parts/TimingComponent.razor @@ -4,6 +4,7 @@ @inject IEconomyService economyService @inject IToastService toastService @inject ITimingService timingService +@implements IDisposable var hotkey = KeyService.GetHotkey(); var hotkeyGroup = KeyService.GetHotkeyGroup(); var isHoldSpace = KeyService.IsHoldingSpace(); - var faction = FilterService.GetFactionType(); - var immortal = FilterService.GetImmortalType(); + var faction = FilterService.GetFaction(); + var immortal = FilterService.GetImmortal(); if (hotkey == "`") { diff --git a/IGP/Pages/Database/DatabasePage.razor b/IGP/Pages/Database/DatabasePage.razor index 826fb23..0e0cc55 100644 --- a/IGP/Pages/Database/DatabasePage.razor +++ b/IGP/Pages/Database/DatabasePage.razor @@ -127,8 +127,8 @@ List searches = default!; - string selectedFactionType = FactionType.Any; - string selectedImmortalType = ImmortalType.Any; + string selectedFactionType = DataType.Any; + string selectedImmortalType = DataType.Any; string selectedEntityType = EntityType.Army; string searchText = ""; @@ -174,7 +174,7 @@ { selectedFactionType = EntityFilterService.GetFactionType(); - if (selectedFactionType == FactionType.Any) + if (selectedFactionType == DataType.Any) { factions = defaults.ToList(); } @@ -199,7 +199,7 @@ { selectedImmortalType = EntityFilterService.GetImmortalType(); - if (selectedImmortalType == ImmortalType.Any) + if (selectedImmortalType == DataType.Any) { immortals = factions.ToList(); } diff --git a/IGP/Pages/Database/Parts/EntityFilterComponent.razor b/IGP/Pages/Database/Parts/EntityFilterComponent.razor index e6cb2cb..e520124 100644 --- a/IGP/Pages/Database/Parts/EntityFilterComponent.razor +++ b/IGP/Pages/Database/Parts/EntityFilterComponent.razor @@ -51,16 +51,16 @@ Faction - - - + + + Immortal - + diff --git a/IGP/Pages/Documentation/DocumentationIndexPage.razor b/IGP/Pages/Documentation/DocumentationIndexPage.razor index 5a20e9f..9ed77b0 100644 --- a/IGP/Pages/Documentation/DocumentationIndexPage.razor +++ b/IGP/Pages/Documentation/DocumentationIndexPage.razor @@ -107,7 +107,7 @@ else documentationService.Load(); } - public void Dispose() + void IDisposable.Dispose() { documentationService.Unsubscribe(StateHasChanged); } diff --git a/IGP/Pages/Documentation/DocumentationPage.razor b/IGP/Pages/Documentation/DocumentationPage.razor index 7a30962..3db1bb4 100644 --- a/IGP/Pages/Documentation/DocumentationPage.razor +++ b/IGP/Pages/Documentation/DocumentationPage.razor @@ -113,7 +113,7 @@ else documentationService.Load(); } - public void Dispose() + void IDisposable.Dispose() { documentationService.Unsubscribe(StateHasChanged); } diff --git a/IGP/Pages/Notes/NotesIndexPage.razor b/IGP/Pages/Notes/NotesIndexPage.razor index 15ee30a..56ead8b 100644 --- a/IGP/Pages/Notes/NotesIndexPage.razor +++ b/IGP/Pages/Notes/NotesIndexPage.razor @@ -125,7 +125,7 @@ else } - public void Dispose() + void IDisposable.Dispose() { noteService.Unsubscribe(StateHasChanged); } diff --git a/IGP/Pages/Notes/NotesPage.razor b/IGP/Pages/Notes/NotesPage.razor index 0d3c1c8..3c8c100 100644 --- a/IGP/Pages/Notes/NotesPage.razor +++ b/IGP/Pages/Notes/NotesPage.razor @@ -112,7 +112,7 @@ else noteService.Load(); } - public void Dispose() + void IDisposable.Dispose() { noteService.Unsubscribe(StateHasChanged); } diff --git a/IGP/Pages/PermissionsPage.razor b/IGP/Pages/PermissionsPage.razor index 04ead98..97430bb 100644 --- a/IGP/Pages/PermissionsPage.razor +++ b/IGP/Pages/PermissionsPage.razor @@ -74,7 +74,7 @@ StateHasChanged(); } - public void Dispose() + void IDisposable.Dispose() { PermissionService.Unsubscribe(Update); } diff --git a/IGP/Pages/StoragePage.razor b/IGP/Pages/StoragePage.razor index c896551..4e5a9c9 100644 --- a/IGP/Pages/StoragePage.razor +++ b/IGP/Pages/StoragePage.razor @@ -1,13 +1,11 @@ @page "/storage" @inject IStorageService StorageService - @using Services.Website @implements IDisposable @layout PageLayout - @if (!_enabledPermissions) { @@ -25,6 +23,90 @@ OnChange="EntityViewChanged"/> + + + + + Attack Time + + @if (_attackTime != null) + { +   T @Interval.ToTime((int)_attackTime) + } + + + + + Travel Time + + @if (_travelTime != null) + { +   T @Interval.ToTime((int)_travelTime) + } + + + + + Faction + + + + + + + + Immortal + + @if (Faction == DataType.FACTION_QRath) + { + + + } + @if (Faction == DataType.FACTION_Aru) + { + + + } + + + + + + Building Input Delay + Add a input delay to constructing buildings for simulating worker movement and player micro. + + + Wait Time + + + + + Wait To + + + + } @@ -41,21 +123,47 @@ { _enabledPermissions = StorageService.GetValue(StorageKeys.EnabledStorage); - Update(); + RefreshDefaults(); - StorageService.Subscribe(Update); + StorageService.Subscribe(RefreshDefaults); } - - - public void Dispose() + + void IDisposable.Dispose() { - StorageService.Unsubscribe(Update); + StorageService.Unsubscribe(RefreshDefaults); } - void Update() + private int? _attackTime = null; + private int? _travelTime = null; + + private string? _faction = null; + private string? _immortal = null; + + private string? Faction => _faction == null ? DataType.FACTION_QRath : _faction; + private string? Immortal => _immortal == null ? DataType.IMMORTAL_Orzum : _immortal; + + + + private int? _buildingInputDelay; + private int? _waitTime; + private int? _waitTo; + + + + void RefreshDefaults() { _isEntityPlainView = StorageService.GetValue(StorageKeys.IsPlainView); + _attackTime = StorageService.GetValue(StorageKeys.AttackTime); + _travelTime = StorageService.GetValue(StorageKeys.TravelTime); + + _faction = StorageService.GetValue(StorageKeys.SelectedFaction); + _immortal = StorageService.GetValue(StorageKeys.SelectedImmortal); + + _buildingInputDelay = StorageService.GetValue(StorageKeys.BuildInputDelay); + _waitTime = StorageService.GetValue(StorageKeys.WaitTime); + _waitTo = StorageService.GetValue(StorageKeys.WaitTo); + StateHasChanged(); } @@ -65,4 +173,39 @@ { StorageService.SetValue(StorageKeys.IsPlainView, obj.Value); } + + private void AttackTimeChanged(ChangeEventArgs obj) + { + StorageService.SetValue(StorageKeys.AttackTime, obj.Value); + } + + private void TravelTimeChanged(ChangeEventArgs obj) + { + StorageService.SetValue(StorageKeys.TravelTime, obj.Value); + } + + private void OnFactionChanged(ChangeEventArgs obj) + { + StorageService.SetValue(StorageKeys.SelectedFaction, obj.Value); + } + + private void OnImmortalChanged(ChangeEventArgs obj) + { + StorageService.SetValue(StorageKeys.SelectedImmortal, obj.Value); + } + private void OnBuildingInputDelayChanged(ChangeEventArgs obj) + { + StorageService.SetValue(StorageKeys.BuildInputDelay, obj.Value); + } + + private void OnWaitTimeChanged(ChangeEventArgs obj) + { + StorageService.SetValue(StorageKeys.WaitTime, obj.Value); + } + + private void OnWaitToChanged(ChangeEventArgs obj) + { + StorageService.SetValue(StorageKeys.WaitTo, obj.Value); + } + } \ No newline at end of file diff --git a/IGP/Portals/EntityDialogPortal.razor b/IGP/Portals/EntityDialogPortal.razor index 4c4aae0..dbe7963 100644 --- a/IGP/Portals/EntityDialogPortal.razor +++ b/IGP/Portals/EntityDialogPortal.razor @@ -15,7 +15,7 @@ entityDialogService.Subscribe(OnUpdate); } - public void Dispose() + void IDisposable.Dispose() { entityDialogService.Unsubscribe(OnUpdate); } diff --git a/IGP/Portals/SearchPortal.razor b/IGP/Portals/SearchPortal.razor index 2d35fe7..edb81e2 100644 --- a/IGP/Portals/SearchPortal.razor +++ b/IGP/Portals/SearchPortal.razor @@ -21,7 +21,7 @@ - public void Dispose() + void IDisposable.Dispose() { searchService.Unsubscribe(OnUpdate); } diff --git a/IGP/Portals/ToastPortal.razor b/IGP/Portals/ToastPortal.razor index 1a79fbf..48330a0 100644 --- a/IGP/Portals/ToastPortal.razor +++ b/IGP/Portals/ToastPortal.razor @@ -38,7 +38,7 @@ ageTimer.Enabled = true; } - public void Dispose() + void IDisposable.Dispose() { toastService.Unsubscribe(OnUpdate); } diff --git a/Model/Entity/Data/DATA.cs b/Model/Entity/Data/DATA.cs index 5f4391d..824063f 100644 --- a/Model/Entity/Data/DATA.cs +++ b/Model/Entity/Data/DATA.cs @@ -231,7 +231,7 @@ public class DATA DataType.IMMORTAL_Mala, new EntityModel(DataType.IMMORTAL_Mala, EntityType.Immortal) .AddPart(new EntityInfoModel { Name = "Mala" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityHarvestModel { Resource = ResourceType.Pyre, HarvestedPerInterval = 1, HarvestDelay = 3, @@ -250,7 +250,7 @@ public class DATA DataType.IMMORTAL_Xol, new EntityModel(DataType.IMMORTAL_Xol, EntityType.Immortal) .AddPart(new EntityInfoModel { Name = "Xol" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityHarvestModel { Resource = ResourceType.Pyre, HarvestedPerInterval = 1, HarvestDelay = 3, @@ -271,7 +271,7 @@ public class DATA DataType.IMMORTAL_Ajari, new EntityModel(DataType.IMMORTAL_Ajari, EntityType.Immortal) .AddPart(new EntityInfoModel { Name = "Ajari" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityHarvestModel { Resource = ResourceType.Pyre, HarvestedPerInterval = 1, HarvestDelay = 3, @@ -289,7 +289,7 @@ public class DATA DataType.IMMORTAL_Orzum, new EntityModel(DataType.IMMORTAL_Orzum, EntityType.Immortal) .AddPart(new EntityInfoModel { Name = "Orzum" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityHarvestModel { Resource = ResourceType.Pyre, HarvestedPerInterval = 1, HarvestDelay = 3, @@ -363,8 +363,8 @@ public class DATA Description = "Provides a fully upgraded base worth of alloy.", Notes = "Revives in 40 seconds when destroyed." }) - .AddPart(new EntityFactionModel { Faction = FactionType.Neutral }) - .AddPart(new EntityFactionModel { Faction = FactionType.Neutral }) + .AddPart(new EntityFactionModel { Faction = DataType.NEUTRAL_PyreCamp }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Neutral }) .AddPart(new EntityHarvestModel { HarvestedPerInterval = 6, RequiresWorker = false, Resource = ResourceType.Alloy, Slots = 1, @@ -383,8 +383,8 @@ public class DATA Name = "Starting Tower", Notes = "Currently not in game. Can be upgraded to the factions pyre tower." }) - .AddPart(new EntityFactionModel { Faction = FactionType.Neutral }) - .AddPart(new EntityFactionModel { Faction = FactionType.Neutral }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Neutral }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Neutral }) .AddPart(new EntityVitalityModel { Health = 1000, DefenseLayer = 500, Armor = ArmorType.Heavy, IsStructure = true }) .AddPart(new EntityWeaponModel @@ -402,7 +402,7 @@ public class DATA new EntityModel(DataType.STARTING_TownHall_Aru, EntityType.Building, true) .AddPart(new EntityInfoModel { Name = "Grove Heart (Starting)", Descriptive = DescriptiveType.Town_Hall_Starting }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityVitalityModel { Health = 2000, DefenseLayer = 400, Armor = ArmorType.Heavy, IsStructure = true }) .AddPart(new EntityHarvestModel @@ -419,7 +419,7 @@ public class DATA new EntityModel(DataType.STARTING_TownHall_QRath, EntityType.Building, true) .AddPart(new EntityInfoModel { Name = "Acropolis (Starting)", Descriptive = DescriptiveType.Town_Hall_Starting }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityVitalityModel { Health = 1600, DefenseLayer = 800, Armor = ArmorType.Heavy, IsStructure = true }) .AddPart(new EntityHarvestModel @@ -443,7 +443,7 @@ public class DATA }) .AddPart(new EntityTierModel { Tier = 1 }) .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "Z" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityVanguardAddedModel { ReplaceId = DataType.UNIT_Sipari, ImmortalId = DataType.IMMORTAL_Orzum }) .AddPart(new EntityProductionModel { Alloy = 100, BuildTime = 24, ProducedBy = DataType.BUILDING_LegionHall}) @@ -474,7 +474,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 EntityFactionModel { Faction = DataType.FACTION_QRath }) .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 }) @@ -511,7 +511,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 EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityVanguardAddedModel { ReplaceId = DataType.UNIT_Magi, ImmortalId = DataType.IMMORTAL_Ajari }) .AddPart(new EntityProductionModel { Alloy = 75, Ether = 75, BuildTime = 35, ProducedBy = DataType.BUILDING_LegionHall }) @@ -545,7 +545,7 @@ public class DATA }) .AddPart(new EntityTierModel { Tier = 2 }) .AddPart(new EntityHotkeyModel { Hotkey = "Q", HoldSpace = true, HotkeyGroup = "Z" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityVanguardAddedModel { ReplaceId = DataType.UNIT_Hallower, ImmortalId = DataType.IMMORTAL_Ajari }) .AddPart(new EntityProductionModel { Alloy = 150, Ether = 100, BuildTime = 40, ProducedBy = DataType.BUILDING_SoulFoundry }) @@ -581,7 +581,7 @@ public class DATA Requirement = RequirementType.Production_Building }) .AddPart(new EntityHotkeyModel { Hotkey = "Q", HoldSpace = true, HotkeyGroup = "Z" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityVanguardAddedModel { ReplaceId = DataType.UNIT_Underspine, ImmortalId = DataType.IMMORTAL_Mala }) .AddPart(new EntityProductionModel { Alloy = 175, Ether = 50, BuildTime = 35, ProducedBy = DataType.BUILDING_AmberWomb }) @@ -610,7 +610,7 @@ public class DATA Requirement = RequirementType.Research_Building }) .AddPart(new EntityHotkeyModel { Hotkey = "F", HoldSpace = true, HotkeyGroup = "Z" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityVanguardAddedModel { ReplaceId = DataType.UNIT_RedSeer, ImmortalId = DataType.IMMORTAL_Mala }) .AddPart(new EntityProductionModel { Alloy = 60, Ether = 150, BuildTime = 45, ProducedBy = DataType.BUILDING_AltarOfTheWorthy }) @@ -639,7 +639,7 @@ public class DATA Requirement = RequirementType.Production_Building }) .AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "Z" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityVanguardAddedModel { ReplaceId = DataType.UNIT_MaskedHunter, ImmortalId = DataType.IMMORTAL_Xol }) .AddPart(new EntityProductionModel { Alloy = 50, Ether = 0, BuildTime = 20, ProducedBy = DataType.BUILDING_AltarOfTheWorthy }) @@ -668,7 +668,7 @@ public class DATA Requirement = RequirementType.Research_Building }) .AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "Z" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityVanguardAddedModel { ReplaceId = DataType.UNIT_Bloodbound, ImmortalId = DataType.IMMORTAL_Xol }) .AddPart(new EntityProductionModel { Alloy = 80, Ether = 80, BuildTime = 35, ProducedBy = DataType.BUILDING_AltarOfTheWorthy }) @@ -692,7 +692,7 @@ public class DATA DataType.WORKER_Mote, new EntityModel(DataType.WORKER_Mote, EntityType.Worker) .AddPart(new EntityInfoModel { Name = "Mote", Descriptive = DescriptiveType.Worker }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 50, BuildTime = 20 }) .AddPart(new EntityVitalityModel { Health = 30, DefenseLayer = 30, Armor = ArmorType.Light }) .AddPart(new EntityMovementModel { Speed = 400, Movement = MovementType.Ground }) @@ -713,7 +713,7 @@ public class DATA .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 EntityFactionModel { Faction = DataType.FACTION_QRath }) .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 }) @@ -744,7 +744,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 EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 75, Ether = 75, BuildTime = 35, ProducedBy = DataType.BUILDING_LegionHall }) .AddPart(new EntitySupplyModel { Takes = 3 }) .AddPart(new EntityVanguardReplacedModel @@ -782,7 +782,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 EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 100, Ether = 40, BuildTime = 30, ProducedBy = DataType.BUILDING_SoulFoundry }) .AddPart(new EntitySupplyModel { Takes = 4 }) .AddPart(new EntityRequirementModel @@ -817,7 +817,7 @@ public class DATA }) .AddPart(new EntityTierModel { Tier = 2 }) .AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "Z" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .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 }) @@ -849,7 +849,7 @@ public class DATA }) .AddPart(new EntityTierModel { Tier = 2 }) .AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "Z" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .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 }) @@ -884,7 +884,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 EntityFactionModel { Faction = DataType.FACTION_QRath }) .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 }) @@ -918,7 +918,7 @@ public class DATA .AddPart(new EntityHotkeyModel { Hotkey = "Q", HoldSpace = true, HotkeyGroup = "Z" }) .AddPart(new EntityVanguardReplacedModel { ImmortalId = DataType.IMMORTAL_Ajari, ReplacedById = DataType.VANGUARD_ArkMother_Ajari }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 150, Ether = 75, BuildTime = 35, ProducedBy = DataType.BUILDING_SoulFoundry }) .AddPart(new EntitySupplyModel { Takes = 5 }) .AddPart(new EntityRequirementModel @@ -950,7 +950,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 EntityFactionModel { Faction = DataType.FACTION_QRath }) .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 }) @@ -976,7 +976,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 EntityFactionModel { Faction = DataType.FACTION_QRath }) .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 }) @@ -1014,7 +1014,7 @@ public class DATA .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 EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 175, Ether = 100, BuildTime = 40, ProducedBy = DataType.BUILDING_Angelarium }) .AddPart(new EntitySupplyModel { Takes = 6 }) .AddPart(new EntityRequirementModel @@ -1036,7 +1036,7 @@ public class DATA .AddPart(new EntityInfoModel { Name = "Shar'U", Descriptive = DescriptiveType.Elite_Caster }) .AddPart(new EntityTierModel { Tier = 3.5f }) .AddPart(new EntityHotkeyModel { Hotkey = "F", HoldSpace = true, HotkeyGroup = "Z" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 110, Ether = 175, BuildTime = 55, ProducedBy = DataType.BUILDING_Angelarium }) .AddPart(new EntitySupplyModel { Takes = 6 }) .AddPart(new EntityRequirementModel @@ -1065,7 +1065,7 @@ public class DATA DataType.WORKER_Symbiote, new EntityModel(DataType.WORKER_Symbiote, EntityType.Worker) .AddPart(new EntityInfoModel { Name = "Symbiote", Descriptive = DescriptiveType.Worker }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityProductionModel { Alloy = 50, BuildTime = 20 }) .AddPart(new EntityRequirementModel { @@ -1096,7 +1096,7 @@ public class DATA Id = DataType.BUILDING_AltarOfTheWorthy, Requirement = RequirementType.Production_Building }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityProductionModel { Alloy = 50, BuildTime = 20, ProducedBy = DataType.BUILDING_AltarOfTheWorthy }) .AddPart(new EntitySupplyModel { Takes = 2 }) .AddPart(new EntityVitalityModel @@ -1124,7 +1124,7 @@ public class DATA Requirement = RequirementType.Research_Building }) .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "Z" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .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 }) @@ -1155,7 +1155,7 @@ public class DATA Requirement = RequirementType.Research_Building }) .AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "Z" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityProductionModel { Alloy = 80, Ether = 80, BuildTime = 30, ProducedBy = DataType.BUILDING_AltarOfTheWorthy }) .AddPart(new EntitySupplyModel { Takes = 4 }) .AddPart(new EntityVitalityModel @@ -1187,7 +1187,7 @@ public class DATA Requirement = RequirementType.Research_Building }) .AddPart(new EntityHotkeyModel { Hotkey = "F", HoldSpace = true, HotkeyGroup = "Z" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityProductionModel { Alloy = 40, Ether = 140, BuildTime = 40, ProducedBy = DataType.BUILDING_AltarOfTheWorthy }) .AddPart(new EntitySupplyModel { Takes = 3 }) .AddPart(new EntityVitalityModel @@ -1224,7 +1224,7 @@ public class DATA Requirement = RequirementType.Research_Building }) .AddPart(new EntityHotkeyModel { Hotkey = "Q", HoldSpace = true, HotkeyGroup = "Z" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .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 }) @@ -1254,7 +1254,7 @@ public class DATA Requirement = RequirementType.Production_Building }) .AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "Z" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .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 }) @@ -1284,7 +1284,7 @@ public class DATA Requirement = RequirementType.Research_Building }) .AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "Z" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .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 }) @@ -1319,7 +1319,7 @@ public class DATA Requirement = RequirementType.Research_Building }) .AddPart(new EntityHotkeyModel { Hotkey = "E", HoldSpace = true, HotkeyGroup = "Z" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .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 }) @@ -1344,7 +1344,7 @@ public class DATA Requirement = RequirementType.Production_Building }) .AddPart(new EntityHotkeyModel { Hotkey = "R", HoldSpace = true, HotkeyGroup = "Z" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .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 }) @@ -1366,7 +1366,7 @@ public class DATA Requirement = RequirementType.Production_Building }) .AddPart(new EntityHotkeyModel { Hotkey = "W", HoldSpace = true, HotkeyGroup = "Z" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .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 }) @@ -1394,7 +1394,7 @@ public class DATA Requirement = RequirementType.Research_Building }) .AddPart(new EntityHotkeyModel { Hotkey = "A", HoldSpace = true, HotkeyGroup = "Z" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .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 }) @@ -1413,7 +1413,7 @@ public class DATA DataType.SUMMON_Quitl, new EntityModel(DataType.SUMMON_Quitl, EntityType.Army) .AddPart(new EntityInfoModel { Name = "Quitl", Descriptive = DescriptiveType.Summon }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityVitalityModel { Health = 65, Armor = ArmorType.Light }) .AddPart(new EntityMovementModel { Speed = 168, Movement = MovementType.Ground }) .AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_Temporary }) @@ -1429,7 +1429,7 @@ public class DATA Description = "Increases the Sipari speed by 75." }) .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "TAB" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 100, Ether = 100, BuildTime = 100, ProducedBy = DataType.BUILDING_Reliquary }) .AddPart(new EntityRequirementModel { @@ -1448,7 +1448,7 @@ public class DATA Description = "Unlocks the dervish's Radiant Ward ability" }) .AddPart(new EntityHotkeyModel { Hotkey = "V", HotkeyGroup = "TAB" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 80, Ether = 80, BuildTime = 34, ProducedBy = DataType.BUILDING_HouseOfFadingSaints }) .AddPart(new EntityRequirementModel { @@ -1466,7 +1466,7 @@ public class DATA Description = "Sipari gain +20 shields, and Hallowed Ground grants an additional +20 shields." }) .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "TAB", HoldSpace = true }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 100, Ether = 100, BuildTime = 43, ProducedBy = DataType.BUILDING_EyeOfAros }) .AddPart(new EntityRequirementModel { @@ -1486,7 +1486,7 @@ public class DATA Description = "Increases the range of the Zentari's ranged weapon." }) .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "TAB" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 50, Ether = 100, BuildTime = 60, ProducedBy = DataType.BUILDING_Reliquary }) .AddPart(new EntityRequirementModel { Id = DataType.BUILDING_Reliquary, Requirement = RequirementType.Research_Building }) @@ -1502,7 +1502,7 @@ public class DATA Description = "Increases the Castigator's anti-air weapon range." }) .AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "TAB", HoldSpace = true }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 75, Ether = 75, BuildTime = 29, ProducedBy = DataType.BUILDING_HouseOfFadingSaints }) .AddPart(new EntityRequirementModel { @@ -1516,7 +1516,7 @@ public class DATA .AddPart(new EntityInfoModel { Name = "Windstep", Descriptive = DescriptiveType.Upgrade, Description = "Unlocks windstep." }) .AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "TAB" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 50, Ether = 75, BuildTime = 55, ProducedBy = DataType.BUILDING_Reliquary }) .AddPart(new EntityRequirementModel { Id = DataType.BUILDING_Reliquary, Requirement = RequirementType.Production_Building }) @@ -1530,7 +1530,7 @@ public class DATA Description = "Increases Zephyr's range by 100." }) .AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "TAB" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 150, Ether = 100, BuildTime = 43, ProducedBy = DataType.BUILDING_Reliquary }) .AddPart(new EntityRequirementModel { Id = DataType.BUILDING_Reliquary, Requirement = RequirementType.Research_Building }) @@ -1546,7 +1546,7 @@ public class DATA Description = "Grant's the Dervish Sirocco Script" }) .AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "TAB" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 75, Ether = 100, BuildTime = 60, ProducedBy = DataType.BUILDING_HouseOfFadingSaints }) .AddPart(new EntityRequirementModel { @@ -1563,7 +1563,7 @@ public class DATA Description = "Grants the Zentari shields and flat armor reduction." }) .AddPart(new EntityHotkeyModel { Hotkey = "Q", HoldSpace = true, HotkeyGroup = "TAB" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 100, Ether = 100, BuildTime = 43, ProducedBy = DataType.BUILDING_EyeOfAros }) .AddPart(new EntityRequirementModel { @@ -1582,7 +1582,7 @@ public class DATA Description = "Unlocks Blades of the Godhead" }) .AddPart(new EntityHotkeyModel { Hotkey = "A", HoldSpace = true, HotkeyGroup = "TAB" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 100, Ether = 75, BuildTime = 45, ProducedBy = DataType.BUILDING_BearerOfTheCrown }) .AddPart(new EntityRequirementModel { @@ -1598,7 +1598,7 @@ public class DATA Description = "Increases the Warden's speed and shields significantly." }) .AddPart(new EntityHotkeyModel { Hotkey = "R", HoldSpace = true, HotkeyGroup = "TAB" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 150, Ether = 100, BuildTime = 30, ProducedBy = DataType.BUILDING_EyeOfAros }) .AddPart(new EntityRequirementModel { @@ -1617,7 +1617,7 @@ public class DATA Description = "Unlocks Offering" }) .AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "TAB" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityVanguardReplacedModel { ImmortalId = DataType.IMMORTAL_Xol, ReplacedById = DataType.UPGRADE_Stalk }) .AddPart(new EntityRequirementModel @@ -1638,7 +1638,7 @@ public class DATA .AddPart(new EntityInfoModel { Name = "Blood Mother's Fevor", Descriptive = DescriptiveType.Upgrade }) .AddPart(new EntityHotkeyModel { Hotkey = "V", HotkeyGroup = "TAB" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityVanguardReplacedModel { ImmortalId = DataType.IMMORTAL_Xol, ReplacedById = DataType.UPGRADE_Ambush }) .AddPart(new EntityRequirementModel @@ -1658,7 +1658,7 @@ public class DATA new EntityModel(DataType.UPGRADE_DenInstinct, EntityType.Tech) .AddPart(new EntityInfoModel { Name = "Den Instinct", Descriptive = DescriptiveType.Upgrade }) .AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "TAB" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityRequirementModel { Id = DataType.BUILDING_Neurocyte, @@ -1671,7 +1671,7 @@ public class DATA new EntityModel(DataType.UPGRADE_PursuitLigaments, EntityType.Tech) .AddPart(new EntityInfoModel { Name = "Pursuit Ligaments", Descriptive = DescriptiveType.Upgrade }) .AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "TAB" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityRequirementModel { Id = DataType.BUILDING_Neurocyte, @@ -1684,7 +1684,7 @@ public class DATA new EntityModel(DataType.UPGRADE_ResinantDeploy, EntityType.Tech) .AddPart(new EntityInfoModel { Name = "Resinant Deploy", Descriptive = DescriptiveType.Upgrade }) .AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "TAB" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityRequirementModel { Id = DataType.BUILDING_Neurocyte, @@ -1702,7 +1702,7 @@ public class DATA new EntityModel(DataType.UPGRADE_XacalDamage, EntityType.Tech) .AddPart(new EntityInfoModel { Name = "Xacal Damage", Descriptive = DescriptiveType.Upgrade }) .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "TAB" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityRequirementModel { Id = DataType.BUILDING_Neurocyte, @@ -1715,7 +1715,7 @@ public class DATA new EntityModel(DataType.UPGRADE_BehemothCapacity, EntityType.Tech) .AddPart(new EntityInfoModel { Name = "Behemoth Capacity", Descriptive = DescriptiveType.Upgrade }) .AddPart(new EntityHotkeyModel { Hotkey = "A", HotkeyGroup = "TAB", HoldSpace = true }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityRequirementModel { Id = DataType.BUILDING_DeepNest, @@ -1733,7 +1733,7 @@ public class DATA Descriptive = DescriptiveType.Upgrade }) .AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "TAB", HoldSpace = true }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityRequirementModel { Id = DataType.BUILDING_Neurocyte, @@ -1752,7 +1752,7 @@ public class DATA Descriptive = DescriptiveType.Upgrade }) .AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "TAB", HoldSpace = false }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityRequirementModel { Id = DataType.BUILDING_Neurocyte, @@ -1773,7 +1773,7 @@ public class DATA Descriptive = DescriptiveType.Upgrade }) .AddPart(new EntityHotkeyModel { Hotkey = "V", HotkeyGroup = "TAB", HoldSpace = false }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityProductionModel { Alloy = 100, Ether = 125, BuildTime = 80, ProducedBy = DataType.BUILDING_RedVale }) .AddPart(new EntityRequirementModel { @@ -1794,7 +1794,7 @@ public class DATA Description = "Unlocks Blood Plague" }) .AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "TAB", HoldSpace = true }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityRequirementModel { Id = DataType.BUILDING_RedVale, @@ -1809,7 +1809,7 @@ public class DATA new EntityModel(DataType.UPGRADE_BirthingStorm, EntityType.Tech) .AddPart(new EntityInfoModel { Name = "Birthing Storm", Descriptive = DescriptiveType.Upgrade }) .AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "TAB", HoldSpace = true }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityRequirementModel { Id = DataType.BUILDING_RedVale, @@ -1831,7 +1831,7 @@ public class DATA Description = @"Bastion generates one scout in 2 minutes, up to a max of 2 scouts. And generates pyre over time." }) - .AddPart(new EntityFactionModel { Faction = FactionType.Any }) + .AddPart(new EntityFactionModel { Faction = DataType.Any }) }, { DataType.PASSIVE_Respite, @@ -1842,7 +1842,7 @@ public class DATA Description = @"Nearby units will slowly heal after not attacking or being attacked for 10 seconds." }) - .AddPart(new EntityFactionModel { Faction = FactionType.Any }) + .AddPart(new EntityFactionModel { Faction = DataType.Any }) }, { @@ -1853,7 +1853,7 @@ public class DATA Name = "Harvest Alloy", Descriptive = DescriptiveType.Passive, Description = "This unit can harvest alloy." }) - .AddPart(new EntityFactionModel { Faction = FactionType.Any }) + .AddPart(new EntityFactionModel { Faction = DataType.Any }) }, // Passives @@ -1868,7 +1868,7 @@ public class DATA Description = @"Gains bonus shields when in Hallowed Ground", Notes = "+20 Shields on Hallowed Ground." }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { @@ -1881,7 +1881,7 @@ public class DATA }) .AddPart(new EntityRequirementModel { Id = DataType.UPGRADE_GreavesOfAhqar, Requirement = RequirementType.Research_Upgrade }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { @@ -1896,7 +1896,7 @@ public class DATA { Id = DataType.UPGRADE_RelicOfTheWrathfulGaze, Requirement = RequirementType.Research_Upgrade }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { DataType.PASSIVE_WingsOfTheKenLatir, @@ -1908,7 +1908,7 @@ public class DATA }) .AddPart(new EntityRequirementModel { Id = DataType.UPGRADE_WingsOfTheKenLatir, Requirement = RequirementType.Research_Upgrade }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { @@ -1919,7 +1919,7 @@ public class DATA Name = "Execution Rites", Descriptive = DescriptiveType.Passive, Description = @"Warden's attacks charge up to a hit that deals greatly increased damage." }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { @@ -1932,7 +1932,7 @@ public class DATA }) .AddPart(new EntityRequirementModel { Id = DataType.UPGRADE_IconOfKhastEem, Requirement = RequirementType.Research_Upgrade }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { @@ -1945,7 +1945,7 @@ public class DATA }) .AddPart(new EntityRequirementModel { Id = DataType.UPGRADE_FaithCastBlades, Requirement = RequirementType.Research_Upgrade }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { @@ -1956,7 +1956,7 @@ public class DATA Name = "Throne Moving Shot", Descriptive = DescriptiveType.Passive, Description = @"Thrones can attack while moving." }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { @@ -1968,7 +1968,7 @@ public class DATA Description = @"Increases the derish's movement speed" }) .AddPart(new EntityRequirementModel { Id = DataType.UPGRADE_SiroccoScript }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { @@ -1979,7 +1979,7 @@ public class DATA Name = "Hallowing Rites", Descriptive = DescriptiveType.Passive, Description = @"Ark Mother's creates Hallowed Ground on stabilize." }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { @@ -1990,7 +1990,7 @@ public class DATA Name = "Hallowed Ruin", Descriptive = DescriptiveType.Passive, Description = @"Hallowers have splash on attacks that leave an area of Hallowed Ground." }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { @@ -2002,7 +2002,7 @@ public class DATA Description = @"Scepters gain energy when stabilized. They lose energy when moving. Energy is spent to have splash on attack." }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { @@ -2013,7 +2013,7 @@ public class DATA Name = "Psalm Of Fire", Descriptive = DescriptiveType.Applies_Debuff, Description = @"Fire Singers deal damage over time against attacked targets." }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { @@ -2024,7 +2024,7 @@ public class DATA Name = "Zeal", Descriptive = DescriptiveType.Passive, Description = @"30% increased attack speed to allied near Pillar of the Heavens" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { @@ -2035,7 +2035,7 @@ public class DATA Name = "Hallowed Ground", Descriptive = DescriptiveType.Passive, Description = @"This building generates Hallowed Ground." }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { @@ -2047,7 +2047,7 @@ public class DATA Description = @"Can spend life instead of energy, when needed.", Notes = "Can't spend more life then unit has. Unit cannot kill itself with Cast From Life." }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { @@ -2060,7 +2060,7 @@ public class DATA }) .AddPart(new EntityRequirementModel { Id = DataType.UPGRADE_WraithBowRange, Requirement = RequirementType.Research_Upgrade }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { @@ -2071,7 +2071,7 @@ public class DATA Name = "Rootway", Descriptive = DescriptiveType.Passive, Description = @"Building generates Rootway." }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { @@ -2082,7 +2082,7 @@ public class DATA Name = "Quitl Storage", Descriptive = DescriptiveType.Passive, Description = @"Unit stores quitl for attacks." }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { @@ -2093,7 +2093,7 @@ public class DATA Name = "Quitl Storage", Descriptive = DescriptiveType.Passive, Description = @"Unit stores more quitl for attacks." }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityRequirementModel { Id = DataType.UPGRADE_BehemothCapacity, Requirement = RequirementType.Research_Upgrade }) }, @@ -2106,7 +2106,7 @@ public class DATA Name = "External Digestion", Descriptive = DescriptiveType.Passive, Description = @"Ichor attacks splash in a cone." }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { @@ -2117,7 +2117,7 @@ public class DATA Name = "Temporary", Descriptive = DescriptiveType.Passive, Description = @"This unit has a limited duration before it dies." }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, @@ -2131,7 +2131,7 @@ public class DATA @"After remaining stationary for several seconds, gain Hidden 3 and a movement speed boost.", Notes = "Lose hidden on attacking" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityRequirementModel { Id = DataType.UPGRADE_Stalk }) }, @@ -2143,7 +2143,7 @@ public class DATA Name = "Ambush", Descriptive = DescriptiveType.Passive, Description = @"This unit deals double damage when attacking from hidden." }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityRequirementModel { Id = DataType.UPGRADE_Ambush }) }, @@ -2155,7 +2155,7 @@ public class DATA Name = "Hidden X", Descriptive = DescriptiveType.Passive, Description = @"This unit cannot be seen unless enemies units are within X." }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { @@ -2166,7 +2166,7 @@ public class DATA Name = "Fallen Harvest", Descriptive = DescriptiveType.Passive, Description = @"Incubator gets energy when nearby non-quitl units die." }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { @@ -2178,7 +2178,7 @@ public class DATA Description = @"Quickly heals a nearby unit" }) .AddPart(new EntityProductionModel { Cooldown = 0.25f }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, @@ -2191,7 +2191,7 @@ public class DATA Description = @"Spends mana to refill the mana of nearby units" }) .AddPart(new EntityProductionModel { Energy = 4, Cooldown = 1 }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { DataType.PASSIVE_FortifiedIcons, @@ -2204,7 +2204,7 @@ public class DATA }) .AddPart(new EntityRequirementModel { Id = DataType.UPGRADE_FortifiedIcons, Requirement = RequirementType.Research_Upgrade }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { DataType.PASSIVE_MendingCommand, @@ -2215,7 +2215,7 @@ public class DATA Description = @"Autocast ability that heals 48 life and 24 shields over 2 seconds." }) .AddPart(new EntityProductionModel { Pyre = 10, Cooldown = 3 }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { DataType.PASSIVE_GodstoneBulwark, @@ -2225,7 +2225,7 @@ public class DATA Name = "Godstone Bulkwark", Descriptive = DescriptiveType.Ability, Description = @"Grants +1 damage reduction." }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { @@ -2238,7 +2238,7 @@ public class DATA @"The Saoshin releases healing energy. Allied units nearby heal over several seconds. This automatically activates when the Saoshin drops below 70 HP." }) .AddPart(new EntityProductionModel { Pyre = 70, Cooldown = 5 }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, // Passives // Aru Passives @@ -2251,7 +2251,7 @@ public class DATA Description = @"Thrums gain more attack speed for a short duration when a near by allied Thrum kills an enemy unit" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { @@ -2265,7 +2265,7 @@ public class DATA }) .AddPart(new EntityRequirementModel { Id = DataType.UPGRADE_XacalDamage, Requirement = RequirementType.Research_Upgrade }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { DataType.PASSIVE_OssifyingSwarm, @@ -2277,7 +2277,7 @@ public class DATA @"Reduces the movement speed and attack speed of enemies near your attack target.", Notes = "10% movement and attack speed. Stacks up to 5 times." }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { @@ -2290,7 +2290,7 @@ public class DATA @"The aarox dies when attacking. Any units in its area of effect suffer damage over time.", Notes = "Deals 75 damage over 3 seconds." }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { @@ -2302,7 +2302,7 @@ public class DATA Description = @"Recovers 5 life when dealing damage, or 10 mana if life is full." }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { @@ -2314,7 +2314,7 @@ public class DATA Description = @"Grants +2 range when deployed on rootway." }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { @@ -2327,7 +2327,7 @@ public class DATA @"Fires a quitl at a target enemy unit." }) .AddPart(new EntityProductionModel { Energy = 35, Cooldown = 2.5f }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { @@ -2339,7 +2339,7 @@ public class DATA Description = @"Units hit by this attack takes +1 damage for a few seconds, to a maximum of +4." }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { @@ -2350,7 +2350,7 @@ public class DATA Name = "Spawn Quitl", Descriptive = DescriptiveType.Ability, Description = @"Unit spawns Quitl on attack." }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, // Abilities @@ -2364,7 +2364,7 @@ public class DATA Description = @"Spawns a mine that reveals enemy units, slows them, and makes them take increased damage for a duration." }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { DefensiveLayer = 30, Cooldown = 40 }) .AddPart(new EntityRequirementModel { Id = DataType.UPGRADE_RadiantWard }) .AddPart(new EntityVitalityModel @@ -2385,7 +2385,7 @@ public class DATA Description = @"Stun ground unit? With Maledictions spell.", Notes = "Not implemented" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { @@ -2398,7 +2398,7 @@ public class DATA @"The Throne loses some of its shields and fires all four of its swords at the target location to deal damage in a small area of effect. This only affects ground units." }) .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "D" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Cooldown = 40 }) }, { @@ -2411,7 +2411,7 @@ public class DATA @"The Zephyr teleports toward target location, draining shields. Windstepping into Halled Ground restores shields instead." }) .AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "D" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Cooldown = 20 }) }, { @@ -2424,7 +2424,7 @@ public class DATA @"The Saoshin leaps to the target location. If she has enough mana, she activates Intervention upon landing." }) .AddPart(new EntityHotkeyModel { Hotkey = "V", HotkeyGroup = "D" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Cooldown = 5, Energy = 70 }) }, { @@ -2437,7 +2437,7 @@ public class DATA @"Creates a large area that grants significant damage reduction to friendly ground troops within. Reduces the Ark Mother's shields to 0 when used." }) .AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "D", HoldSpace = true }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Cooldown = 5, Energy = 75 }) }, { @@ -2450,7 +2450,7 @@ public class DATA @"Deploying the Absolver drastically increases its attack speed." }) .AddPart(new EntityHotkeyModel { Hotkey = "V", HotkeyGroup = "D" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { DataType.ABILITY_DeployMagi, @@ -2462,7 +2462,7 @@ public class DATA @"Deploys the Magic to project Hallowed Ground around it." }) .AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "D" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, { DataType.ABILITY_Awestrike, @@ -2474,7 +2474,7 @@ public class DATA @"After a short delay, enemy ground units at center of the area suffer a huge burst of damage. Targets outside the center take reduced damage. Then the area is left ablaze damaging units over time." }) .AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "D" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Cooldown = 8, Energy = 60 }) }, { @@ -2487,7 +2487,7 @@ public class DATA @"Mobilize all deployed Q'Rath units." }) .AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "D" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) }, // Abilities // Aru @@ -2501,7 +2501,7 @@ public class DATA @"Mobilize all deployed Aru units." }) .AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "D" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { DataType.ABILITY_Offering, @@ -2513,7 +2513,7 @@ public class DATA "Sacrifices 10 life to give Masked Hunters +3 damage for 3 shots. And increased speed and attack speed." }) .AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "D" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityRequirementModel { Id = DataType.UPGRADE_Offering }) }, { @@ -2526,7 +2526,7 @@ public class DATA "The aarox dives down into the ground, dealing damage in a smaller area. Non-hovering units in the area take additional damage over time." }) .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "D" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { DataType.ABILITY_CullingStrike, @@ -2538,7 +2538,7 @@ public class DATA "Teleports to target location, and deals massive damage to the nearest ground unit." }) .AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "D" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityProductionModel { Energy = 40, Cooldown = 3 }) }, { @@ -2554,7 +2554,7 @@ public class DATA .AddPart(new EntityVanguardAddedModel { ImmortalId = DataType.IMMORTAL_Xol, ReplaceId = DataType.ABILITY_CullingStrike }) .AddPart(new EntityProductionModel { Energy = 40 }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { DataType.ABILITY_DrainingEmbrace, @@ -2566,7 +2566,7 @@ public class DATA }) .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "D" }) .AddPart(new EntityProductionModel { Energy = 25, Cooldown = 5 }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { DataType.ABILITY_BloodPlague, @@ -2579,7 +2579,7 @@ public class DATA }) .AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "D" }) .AddPart(new EntityProductionModel { Energy = 75, Cooldown = 2 }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { DataType.ABILITY_DeployMobilizeResinant, @@ -2590,7 +2590,7 @@ public class DATA Description = "Deploying the Resinant enables it to deal area of effect damage at long range." }) .AddPart(new EntityHotkeyModel { Hotkey = "V", HotkeyGroup = "D" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { DataType.ABILITY_DeployMobilizeUnderSpine, @@ -2602,7 +2602,7 @@ public class DATA "Burrow into the ground to generate rootway and attack air units. Enemies near your attack target will be slowed for a short duration." }) .AddPart(new EntityHotkeyModel { Hotkey = "E", HoldSpace = true, HotkeyGroup = "D" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) }, { DataType.ABILITY_RootVice, @@ -2615,7 +2615,7 @@ public class DATA }) .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "D" }) .AddPart(new EntityVanguardAddedModel { ImmortalId = DataType.IMMORTAL_Mala }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityProductionModel { Energy = 50, Cooldown = 10 }) }, { @@ -2631,7 +2631,7 @@ public class DATA }) .AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "D" }) .AddPart(new EntityVanguardAddedModel { ImmortalId = DataType.IMMORTAL_Mala }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityProductionModel { Energy = 80, Cooldown = 2 }) }, { @@ -2643,7 +2643,7 @@ public class DATA Description = "Summons a temporary long-range siege structure at the target location." }) .AddPart(new EntityHotkeyModel { Hotkey = "R", HoldSpace = true, HotkeyGroup = "D" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityVanguardAddedModel { ImmortalId = DataType.IMMORTAL_Mala, ReplaceId = DataType.UNIT_Acaaluk }) .AddPart(new EntityProductionModel { Energy = 80, BuildTime = 4, Cooldown = 20 }) @@ -2665,7 +2665,7 @@ public class DATA Description = "The red seer is sacrificed to create an acaaluk." }) .AddPart(new EntityHotkeyModel { Hotkey = "R", HoldSpace = true, HotkeyGroup = "D" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityProductionModel { Alloy = 100, BuildTime = 25 }) .AddPart(new EntitySupplyModel { Takes = 6 }) .AddPart(new EntityRequirementModel @@ -2687,7 +2687,7 @@ public class DATA Description = "Creates a powerful defensive structure on a Tower Foundation." }) .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "1" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Pyre = 75, BuildTime = 70 }) .AddPart(new EntityVitalityModel { Health = 1000, DefenseLayer = 500, Armor = ArmorType.Heavy, IsStructure = true }) @@ -2709,7 +2709,7 @@ public class DATA @"Summons a powerful monument that slams into the ground to deal damage to enemy ground units (and takes damage from everything it lands on). It then creates Hallowed Ground and nearby friendly units gain Attack Speed" }) .AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "1" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityVanguardAddedModel { ImmortalId = DataType.IMMORTAL_Orzum }) .AddPart(new EntityProductionModel { Pyre = 100, Cooldown = 15 }) .AddPart(new EntityVitalityModel @@ -2726,7 +2726,7 @@ public class DATA @"Structures in target area reduce incoming damage significantly for several seconds." }) .AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "1" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityVanguardAddedModel { ImmortalId = DataType.IMMORTAL_Orzum }) .AddPart(new EntityProductionModel { Pyre = 50, Cooldown = 15 }) }, @@ -2740,7 +2740,7 @@ public class DATA @"Allied units in a large area gain Movement Speed and gain Attack Speed for several seconds." }) .AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "1" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Any }) + .AddPart(new EntityFactionModel { Faction = DataType.Any }) .AddPart(new EntityProductionModel { Pyre = 75, Cooldown = 20 }) }, { @@ -2753,7 +2753,7 @@ public class DATA @"Units in the area . After a short delay, allied units in teh area teleport to your nearest Town Hall." }) .AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "1" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityVanguardAddedModel { ImmortalId = DataType.IMMORTAL_Ajari }) .AddPart(new EntityProductionModel { Pyre = 50, Cooldown = 60 }) }, @@ -2767,7 +2767,7 @@ public class DATA @"All allied units gain bonus shields for several seconds." }) .AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "1" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityVanguardAddedModel { ImmortalId = DataType.IMMORTAL_Ajari }) .AddPart(new EntityProductionModel { Pyre = 150, Cooldown = 120 }) }, @@ -2782,7 +2782,7 @@ public class DATA Description = "Creates a powerful defensive structure on a Tower Foundation." }) .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "1" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityProductionModel { Pyre = 75, BuildTime = 70 }) .AddPart(new EntityVitalityModel { Health = 1200, DefenseLayer = 200, Armor = ArmorType.Heavy, IsStructure = true }) @@ -2801,7 +2801,7 @@ public class DATA "Creates a rootway generating structure that heals nearby allied units, and transfers it's blood to nearby allied units." }) .AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "1" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityProductionModel { Pyre = 50, Cooldown = 21 }) .AddPart(new EntityVitalityModel { Health = 400, Energy = 100, DefenseLayer = 50, Armor = ArmorType.Heavy, IsStructure = true }) @@ -2819,7 +2819,7 @@ public class DATA }) .AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "1" }) .AddPart(new EntityVanguardAddedModel { ImmortalId = DataType.IMMORTAL_Mala }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityProductionModel { Pyre = 40, Cooldown = 60 }) }, { @@ -2831,7 +2831,7 @@ public class DATA Description = "Massively increases life, shield and mana regeneration for 30 seconds." }) .AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "1" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityVanguardAddedModel { ImmortalId = DataType.IMMORTAL_Mala }) .AddPart(new EntityProductionModel { Pyre = 130, Cooldown = 30 }) }, @@ -2846,7 +2846,7 @@ public class DATA Notes = "+3 pyre for kills" }) .AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "1" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityVanguardAddedModel { ImmortalId = DataType.IMMORTAL_Xol }) .AddPart(new EntityProductionModel { Cooldown = 15, Pyre = 25 }) }, @@ -2859,7 +2859,7 @@ public class DATA Description = "Enemy unit and structures have their vision reduce to 3 for a short time." }) .AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "1" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityVanguardAddedModel { ImmortalId = DataType.IMMORTAL_Xol }) .AddPart(new EntityProductionModel { Pyre = 150, Cooldown = 120 }) }, @@ -2875,7 +2875,7 @@ public class DATA Description = "Town Hall (Structure) - Necessary for collecting Alloy and Ether." }) .AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "C" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 350, BuildTime = 100, RequiresWorker = true, ConsumesWorker = true }) .AddPart(new EntityVitalityModel @@ -2896,7 +2896,7 @@ public class DATA Description = "Upgrades the nearest resource cluster to allow more workers to mine from it." }) .AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "CONTROL" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityRequirementModel { Id = DataType.BUILDING_Acropolis, @@ -2918,7 +2918,7 @@ public class DATA Description = "Upgrades the nearest resource cluster to allow more workers to mine from it." }) .AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "CONTROL" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityRequirementModel { Id = DataType.BUPGRADE_MiningLevel2_QRath, @@ -2940,7 +2940,7 @@ public class DATA Description = "Ether Extractor (Structure) - Must be placed on an Ether Node." }) .AddPart(new EntityHotkeyModel { Hotkey = "V", HotkeyGroup = "C" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 100, BuildTime = 30, RequiresWorker = true }) .AddPart(new EntityVitalityModel { Health = 250, DefenseLayer = 150, Armor = ArmorType.Heavy, IsStructure = true }) @@ -2959,7 +2959,7 @@ public class DATA Description = "Army Production (Structure) - Produces infantry units." }) .AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "C" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntitySupplyModel { Grants = 16 }) .AddPart(new EntityProductionModel { Alloy = 250, BuildTime = 38, RequiresWorker = true }) .AddPart(new EntityVitalityModel @@ -2975,7 +2975,7 @@ public class DATA Description = "Q'Rath Defensive structure." }) .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "C" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 150, BuildTime = 30, RequiresWorker = true }) .AddPart(new EntityRequirementModel { @@ -2995,7 +2995,7 @@ public class DATA Description = "" }) .AddPart(new EntityHotkeyModel { Hotkey = "V", HoldSpace = true, HotkeyGroup = "C" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 125, BuildTime = 30, RequiresWorker = true }) .AddPart(new EntityVitalityModel { Health = 350, DefenseLayer = 450, Armor = ArmorType.Heavy, IsStructure = true }) @@ -3010,7 +3010,7 @@ public class DATA "Research (Structure) - Unlocks the Zephyr and Magi at the Legion Hall. Contains Legion Hall research." }) .AddPart(new EntityHotkeyModel { Hotkey = "W", HoldSpace = true, HotkeyGroup = "C" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 150, Ether = 10, BuildTime = 45, RequiresWorker = true }) .AddPart(new EntityRequirementModel @@ -3030,7 +3030,7 @@ public class DATA Description = "Army Production (Structure) - Produces advanced ground units." }) .AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "C" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 250, Ether = 80, BuildTime = 45, RequiresWorker = true }) .AddPart(new EntitySupplyModel { Grants = 16 }) @@ -3052,7 +3052,7 @@ public class DATA Description = "Research (Structure) - Has tech for the Soul Foundry. Unlocks Hallower." }) .AddPart(new EntityHotkeyModel { Hotkey = "E", HoldSpace = true, HotkeyGroup = "C" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 175, Ether = 200, BuildTime = 52, RequiresWorker = true }) .AddPart(new EntityRequirementModel @@ -3072,7 +3072,7 @@ public class DATA Description = "Army Production (Structure) - Produces flying units" }) .AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "C" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 250, Ether = 80, BuildTime = 48, RequiresWorker = true }) .AddPart(new EntitySupplyModel { Grants = 16 }) @@ -3094,7 +3094,7 @@ public class DATA Description = "Research (Structure) - Unlocks the Shar'U and some late-game Q'Rath upgrades." }) .AddPart(new EntityHotkeyModel { Hotkey = "F", HoldSpace = true, HotkeyGroup = "C" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 200, Ether = 200, BuildTime = 36, RequiresWorker = true }) .AddPart(new EntityRequirementModel @@ -3114,7 +3114,7 @@ public class DATA Description = "Research (Structure) - Unlocks the Throne and researches for Angelarium." }) .AddPart(new EntityHotkeyModel { Hotkey = "R", HoldSpace = true, HotkeyGroup = "C" }) - .AddPart(new EntityFactionModel { Faction = FactionType.QRath }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityProductionModel { Alloy = 250, Ether = 200, BuildTime = 52, RequiresWorker = true }) .AddPart(new EntityRequirementModel @@ -3136,7 +3136,7 @@ public class DATA Description = "Town Hall (Structure) - Necessary for collection Alloy and Ether." }) //TODO: Add Alloy, Ether and Pyre, Supply to the database .AddPart(new EntityHotkeyModel { Hotkey = "F", HotkeyGroup = "C" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityProductionModel { Alloy = 350, BuildTime = 100, RequiresWorker = true }) .AddPart(new EntityVitalityModel { @@ -3155,7 +3155,7 @@ public class DATA new EntityModel(DataType.BUPGRADE_GodHeart, EntityType.Building_Upgrade) .AddPart(new EntityInfoModel { Name = "God Heart", Descriptive = DescriptiveType.Upgrade }) .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "CONTROL" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityVitalityModel { Health = 2150, DefenseLayer = 450, Armor = ArmorType.Heavy, IsStructure = true }) .AddPart(new EntityRequirementModel @@ -3181,7 +3181,7 @@ public class DATA Description = "Upgrades the nearest resource cluster to allow more workers to mine from it." }) .AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "CONTROL" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityRequirementModel { Id = DataType.BUILDING_GroveHeart, @@ -3203,7 +3203,7 @@ public class DATA Description = "Upgrades the nearest resource cluster to allow more workers to mine from it." }) .AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "CONTROL" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityRequirementModel { Id = DataType.BUPGRADE_MiningLevel2_Aru, @@ -3225,7 +3225,7 @@ public class DATA Description = "Ether Extractor (Structure) - Must be placed on an Ether Node." }) //TODO Add Ether Node to database .AddPart(new EntityHotkeyModel { Hotkey = "V", HotkeyGroup = "C" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityProductionModel { Alloy = 100, BuildTime = 30, RequiresWorker = true }) .AddPart(new EntityVitalityModel { Health = 400, DefenseLayer = 100, Armor = ArmorType.Heavy, IsStructure = true }) @@ -3244,7 +3244,7 @@ public class DATA Description = "Army Production (Structure) - Produces infantry ground units" }) .AddPart(new EntityHotkeyModel { Hotkey = "W", HotkeyGroup = "C" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntitySupplyModel { Grants = 16 }) .AddPart(new EntityProductionModel { Alloy = 250, BuildTime = 36, RequiresWorker = true }) .AddPart(new EntityVitalityModel @@ -3260,7 +3260,7 @@ public class DATA Description = "Research (Structure) - Unlocks additional research." }) .AddPart(new EntityHotkeyModel { Hotkey = "F", HoldSpace = true, HotkeyGroup = "C" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityProductionModel { Alloy = 100, Ether = 75, BuildTime = 30, RequiresWorker = true }) .AddPart(new EntityRequirementModel @@ -3280,7 +3280,7 @@ public class DATA Description = "Defense Structure - Aru anti-air defense structure." }) .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "C" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityProductionModel { Alloy = 100, BuildTime = 18, RequiresWorker = true }) .AddPart(new EntityVitalityModel { Health = 300, DefenseLayer = 50, Armor = ArmorType.Heavy, IsStructure = true }) @@ -3290,7 +3290,7 @@ public class DATA new EntityModel(DataType.BUPGRADE_Omnivore, EntityType.Building_Upgrade) .AddPart(new EntityInfoModel { Name = "Omnivore", Descriptive = DescriptiveType.Upgrade }) .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "SHIFT" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityRequirementModel { Id = DataType.DEFENSE_Aerovore, @@ -3309,7 +3309,7 @@ public class DATA Description = "Army Production (Structure) - Produces advanced ground units" }) .AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "C" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityProductionModel { Alloy = 250, Ether = 80, BuildTime = 45, RequiresWorker = true }) .AddPart(new EntitySupplyModel { Grants = 16 }) @@ -3336,7 +3336,7 @@ public class DATA Description = "Army Production (Structure) - Aru air production." }) .AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "C" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityProductionModel { Alloy = 250, Ether = 80, BuildTime = 36, RequiresWorker = true }) .AddPart(new EntitySupplyModel { Grants = 16 }) @@ -3358,7 +3358,7 @@ public class DATA Description = "Unlocks the advanced units at the Altar of the Worthy." }) .AddPart(new EntityHotkeyModel { Hotkey = "W", HoldSpace = true, HotkeyGroup = "C" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityProductionModel { Alloy = 100, Ether = 100, BuildTime = 36, RequiresWorker = true }) .AddPart(new EntityRequirementModel @@ -3378,7 +3378,7 @@ public class DATA Description = "Unlocks the advanced units and researches at the Bone Canopy." }) .AddPart(new EntityHotkeyModel { Hotkey = "R", HoldSpace = true, HotkeyGroup = "C" }) - .AddPart(new EntityFactionModel { Faction = FactionType.Aru }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityProductionModel { Alloy = 175, Ether = 150, BuildTime = 38, RequiresWorker = true }) .AddPart(new EntityRequirementModel diff --git a/Model/Entity/Data/Ids_Entity.cs b/Model/Entity/Data/Ids_Entity.cs index 05c9eeb..0d36e4b 100644 --- a/Model/Entity/Data/Ids_Entity.cs +++ b/Model/Entity/Data/Ids_Entity.cs @@ -2,6 +2,9 @@ public static class DataType { + public static string Any = "Any"; + public static string None = "None"; + public static string PYREEVENT_TowerKilled = "9a923928-b016-49f2-8c7d-950abf09e287"; public static string PYREEVENT_CampTaken = "cc27a9b2-69e2-4322-8102-7a9f8bea7871"; public static string PYREEVENT_MinerTaken = "5b158cf2-2810-4a2a-8131-c4fe4b392ce9"; @@ -14,6 +17,8 @@ public static class DataType public static string FAMILY_Rae = "ce8d60f3-b590-4619-ad90-27e65f77312b"; public static string FAMILY_Demonic = "f61a3630-9474-4ec3-bc71-997cacc52bc1"; public static string FAMILY_NazRa = "56cc934f-57a9-442c-909a-25690f836679"; + + public static string FACTION_Neutral = "95da29af-99da-45fe-80f6-4ae1cc0d0f47"; public static string FACTION_Aru = "fb103962-7518-48df-b7d9-83906a009db8"; public static string FACTION_Iratek = "dbc12bda-b4f2-4fa0-8270-18dc1646d62d"; public static string FACTION_Yul = "9c0492af-1ef8-4113-9010-92178493f8b3"; diff --git a/Model/Entity/Parts/EntityFactionModel.cs b/Model/Entity/Parts/EntityFactionModel.cs index 995e759..5b3d6f3 100644 --- a/Model/Entity/Parts/EntityFactionModel.cs +++ b/Model/Entity/Parts/EntityFactionModel.cs @@ -1,9 +1,10 @@ -using Model.Types; +using Model.Entity.Data; +using Model.Types; namespace Model.Entity.Parts; public class EntityFactionModel : IEntityPartInterface { public string Type { get; set; } = "EntityFactionModel"; - public string Faction { get; set; } = FactionType.QRath; + public string Faction { get; set; } = DataType.FACTION_QRath; } \ No newline at end of file diff --git a/Model/Entity/Types/FactionType.cs b/Model/Entity/Types/FactionType.cs deleted file mode 100644 index cea3485..0000000 --- a/Model/Entity/Types/FactionType.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Model.Types; - -public static class FactionType -{ - public static string None = "None"; - public static string Any = "Any"; - public static string Neutral = "Neutral"; - public static string QRath = "QRath"; - public static string Aru = "Aru"; - public static string Jora = "Jora"; - public static string Talmetra = "Talmetra"; - public static string Iratek = "Iratek"; - public static string Herlesh = "Herlesh"; -} \ No newline at end of file diff --git a/Model/Entity/Types/ImmortalType.cs b/Model/Entity/Types/ImmortalType.cs deleted file mode 100644 index e6cfa00..0000000 --- a/Model/Entity/Types/ImmortalType.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace Model.Types; - -public static class ImmortalType -{ - public static string None = "None"; - public static string Any = "Any"; -} \ No newline at end of file diff --git a/Model/Model.csproj b/Model/Model.csproj index 21841e5..ccf37ca 100644 --- a/Model/Model.csproj +++ b/Model/Model.csproj @@ -4,7 +4,7 @@ net7.0 - - + + diff --git a/Services/IServices.cs b/Services/IServices.cs index 5f521cb..9e2e68b 100644 --- a/Services/IServices.cs +++ b/Services/IServices.cs @@ -1,5 +1,4 @@ -using Microsoft.AspNetCore.Components.ProtectedBrowserStorage; -using Model.BuildOrders; +using Model.BuildOrders; using Model.Doc; using Model.Economy; using Model.Entity; @@ -11,7 +10,6 @@ using Model.Website; using Model.Website.Enums; using Model.Work.Tasks; using Services.Immortal; -using Services.Website; namespace Services; @@ -44,10 +42,10 @@ public interface IPermissionService public bool GetIsStorageEnabled(); public bool GetIsDataCollectionEnabled(); - + public void SetIsStorageEnabled(bool isEnabled); public void SetIsDataCollectionEnabled(bool isEnabled); - + Task Load(); } @@ -226,6 +224,9 @@ public interface IBuildComparisonService public interface ITimingService { + public int BuildingInputDelay { get; set; } + public int WaitTime { get; set; } + public int WaitTo { get; set; } public int GetAttackTime(); public void SetAttackTime(int timing); public int GetTravelTime(); @@ -284,10 +285,10 @@ public interface IEntityDisplayService public interface IImmortalSelectionService { - public string GetFactionType(); - public string GetImmortalType(); - public bool SelectFactionType(string factionType); - public bool SelectImmortalType(string immortalType); + public string GetFaction(); + public string GetImmortal(); + public bool SelectFaction(string faction); + public bool SelectImmortal(string immortal); public void Subscribe(Action action); public void Unsubscribe(Action action); } @@ -323,7 +324,6 @@ public interface IMemoryTesterService public interface IBuildOrderService { - public int BuildingInputDelay { get; set; } public Dictionary> StartedOrders { get; } public Dictionary> CompletedOrders { get; } public Dictionary UniqueCompletedTimes { get; } diff --git a/Services/Immortal/BuildOrderService.cs b/Services/Immortal/BuildOrderService.cs index 2db51eb..cd942e5 100644 --- a/Services/Immortal/BuildOrderService.cs +++ b/Services/Immortal/BuildOrderService.cs @@ -14,18 +14,20 @@ public class BuildOrderService : IBuildOrderService { private readonly BuildOrderModel _buildOrder = new(); + private readonly ITimingService _timingService; + private readonly IToastService _toastService; + private int _lastInterval; - public BuildOrderService(IToastService toastService) + public BuildOrderService(IToastService toastService, ITimingService timingService) { _toastService = toastService; + _timingService = timingService; Reset(); } - public int BuildingInputDelay { get; set; } = 2; - public Dictionary> StartedOrders => _buildOrder.StartedOrders; public Dictionary> CompletedOrders => _buildOrder.CompletedOrders; public Dictionary UniqueCompletedTimes => _buildOrder.UniqueCompletedTimes; @@ -241,14 +243,12 @@ public class BuildOrderService : IBuildOrderService _buildOrder.UniqueCompleted[entityRemoved.DataType] .Remove(_buildOrder.UniqueCompleted[entityRemoved.DataType].Last()); - if (entityRemoved.Production() != null - && entityRemoved.Production()!.ProducedBy != null - && entityRemoved.Supply() != null + if (entityRemoved.Production() != null + && entityRemoved.Production()!.ProducedBy != null + && entityRemoved.Supply() != null && entityRemoved.Supply()!.Takes > 0) - { _buildOrder.TrainingCapacityUsed.Remove(_buildOrder.TrainingCapacityUsed.Last()); - } - + if (entityRemoved.Info().Descriptive == DescriptiveType.Worker) { RemoveLast(); @@ -339,7 +339,7 @@ public class BuildOrderService : IBuildOrderService public int? WillMeetTrainingQueue(EntityModel entity) { Console.WriteLine($"WillMeetTrainingQueue {entity.Info().Name}"); - + var supply = entity.Supply(); var production = entity.Production(); @@ -348,7 +348,7 @@ public class BuildOrderService : IBuildOrderService if (supply == null || production == null || supply.Takes.Equals(0)) { Console.WriteLine(supply == null ? "Was Null" : supply.Takes); - + return 1; } @@ -358,47 +358,50 @@ public class BuildOrderService : IBuildOrderService Console.WriteLine("Produced by Nothing"); return 1; } + var uniqueCompleted = _buildOrder.UniqueCompleted[producedBy]; - + var shortestIncrement = int.MaxValue; var trainingSlots = 0; - bool didDelay = false; + var didDelay = false; foreach (var productionEntity in uniqueCompleted) trainingSlots += productionEntity.Supply()!.Grants; - + while (true) { var usedSlots = 0; foreach (var used in _buildOrder.TrainingCapacityUsed) if (checkedInterval >= used.StartingUsageTime && checkedInterval < used.StopUsageTime) - { + { usedSlots += used.UsedSlots; var duration = used.StopUsageTime - used.StartingUsageTime; if (duration < shortestIncrement) shortestIncrement = duration; - - Console.WriteLine($"Used slots {used.UsedSlots} Duration {duration} Start {used.StartingUsageTime} Stop {used.StopUsageTime} "); + Console.WriteLine( + $"Used slots {used.UsedSlots} Duration {duration} Start {used.StartingUsageTime} Stop {used.StopUsageTime} "); } if (usedSlots + supply.Takes <= trainingSlots) { if (didDelay) - { - _toastService.AddToast(new ToastModel{Title = "Waited", SeverityType = SeverityType.Information, Message = $"Had to wait {checkedInterval - _lastInterval}s for Training Queue."}); - } - + _toastService.AddToast(new ToastModel + { + Title = "Waited", SeverityType = SeverityType.Information, + Message = $"Had to wait {checkedInterval - _lastInterval}s for Training Queue." + }); + Console.WriteLine($"Time {checkedInterval} did Delay {didDelay}"); - + return checkedInterval; } + checkedInterval += shortestIncrement; didDelay = true; if (shortestIncrement == int.MaxValue) { - - Console.WriteLine($"MaxValue"); + Console.WriteLine("MaxValue"); return null; } } @@ -421,7 +424,7 @@ public class BuildOrderService : IBuildOrderService { atInterval = interval; - if (entity.EntityType != EntityType.Army) atInterval += BuildingInputDelay; + if (entity.EntityType != EntityType.Army) atInterval += _timingService.BuildingInputDelay; return true; } diff --git a/Services/Immortal/EntityDisplayService.cs b/Services/Immortal/EntityDisplayService.cs index 5b9cc54..80425de 100644 --- a/Services/Immortal/EntityDisplayService.cs +++ b/Services/Immortal/EntityDisplayService.cs @@ -6,20 +6,20 @@ public class EntityViewType { public static string Detailed = "Detailed"; public static string Plain = "Plain"; - } + public class EntityDisplayService : IEntityDisplayService { private string _displayType; public EntityDisplayService(IStorageService storageService) { - _displayType = storageService.GetValue(StorageKeys.IsPlainView) - ? EntityViewType.Plain : EntityViewType.Detailed; + _displayType = storageService.GetValue(StorageKeys.IsPlainView) + ? EntityViewType.Plain + : EntityViewType.Detailed; } - - - + + public List DefaultChoices() { return new List { EntityViewType.Detailed, EntityViewType.Plain }; @@ -42,7 +42,7 @@ public class EntityDisplayService : IEntityDisplayService public void SetDisplayType(string displayType) { - this._displayType = displayType; + _displayType = displayType; NotifyDataChanged(); } diff --git a/Services/Immortal/EntityFilterService.cs b/Services/Immortal/EntityFilterService.cs index ec180ec..ec5e039 100644 --- a/Services/Immortal/EntityFilterService.cs +++ b/Services/Immortal/EntityFilterService.cs @@ -16,12 +16,12 @@ public class EntityFilterService : IEntityFilterService { private readonly List _entityChoices = new(); - private readonly List _factionChoices = new() { FactionType.Any, FactionType.QRath, FactionType.Aru }; + private readonly List _factionChoices = new() { DataType.Any, DataType.FACTION_QRath, DataType.FACTION_Aru }; private readonly List _immortalChoices = new(); private string _entityType = EntityType.Army; private string _searchText = ""; - private string _selectedFaction = FactionType.Any; - private string _selectedImmortal = ImmortalType.Any; + private string _selectedFaction = DataType.Any; + private string _selectedImmortal = DataType.Any; public EntityFilterService() { @@ -59,8 +59,8 @@ public class EntityFilterService : IEntityFilterService { if (_selectedFaction == factionType) { - _selectedFaction = FactionType.None; - _selectedImmortal = ImmortalType.None; + _selectedFaction = DataType.None; + _selectedImmortal = DataType.None; RefreshImmortalChoices(); RefreshEntityChoices(); @@ -71,7 +71,7 @@ public class EntityFilterService : IEntityFilterService } _selectedFaction = factionType; - _selectedImmortal = ImmortalType.Any; + _selectedImmortal = DataType.Any; RefreshImmortalChoices(); RefreshEntityChoices(); @@ -84,7 +84,7 @@ public class EntityFilterService : IEntityFilterService { if (_selectedImmortal == immortalType) { - _selectedImmortal = ImmortalType.None; + _selectedImmortal = DataType.None; NotifyDataChanged(EntityFilterEvent.OnRefreshImmortal); return true; } @@ -148,13 +148,13 @@ public class EntityFilterService : IEntityFilterService _immortalChoices.Add(ImmortalType.Xol); }*/ - if (_selectedFaction == FactionType.QRath || _selectedFaction == FactionType.Any) + if (_selectedFaction == DataType.FACTION_QRath || _selectedFaction == DataType.Any) { _immortalChoices.Add(DataType.IMMORTAL_Orzum); _immortalChoices.Add(DataType.IMMORTAL_Ajari); } - if (_selectedFaction == FactionType.Aru || _selectedFaction == FactionType.Any) + if (_selectedFaction == DataType.FACTION_Aru || _selectedFaction == DataType.Any) { _immortalChoices.Add(DataType.IMMORTAL_Mala); _immortalChoices.Add(DataType.IMMORTAL_Xol); @@ -165,8 +165,8 @@ public class EntityFilterService : IEntityFilterService { _entityChoices.Clear(); - if (_selectedFaction == FactionType.QRath || _selectedFaction == FactionType.Aru || - _selectedFaction == FactionType.Any) + if (_selectedFaction == DataType.FACTION_QRath || _selectedFaction == DataType.FACTION_Aru || + _selectedFaction == DataType.Any) { _entityChoices.Add(EntityType.Army); _entityChoices.Add(EntityType.Immortal); @@ -178,7 +178,7 @@ public class EntityFilterService : IEntityFilterService _entityChoices.Add(EntityType.Worker); } - if (_selectedFaction == FactionType.Any) _entityChoices.Add(EntityType.Any); + if (_selectedFaction == DataType.Any) _entityChoices.Add(EntityType.Any); } diff --git a/Services/Immortal/ImmortalSelectionService.cs b/Services/Immortal/ImmortalSelectionService.cs index ff44c86..9efeb97 100644 --- a/Services/Immortal/ImmortalSelectionService.cs +++ b/Services/Immortal/ImmortalSelectionService.cs @@ -1,13 +1,29 @@ using Model.Entity.Data; -using Model.Types; +using Services.Website; namespace Services.Immortal; -public class ImmortalSelectionService : IImmortalSelectionService +public class ImmortalSelectionService : IImmortalSelectionService, IDisposable { - private string _selectedFaction = FactionType.QRath; + private string _selectedFaction = DataType.FACTION_QRath; private string _selectedImmortal = DataType.IMMORTAL_Orzum; + private readonly IStorageService _storageService; + + public ImmortalSelectionService(IStorageService storageService) + { + _storageService = storageService; + + _storageService.Subscribe(RefreshDefaults); + + RefreshDefaults(); + } + + void IDisposable.Dispose() + { + _storageService.Unsubscribe(RefreshDefaults); + } + public void Subscribe(Action action) { OnChange += action; @@ -18,37 +34,49 @@ public class ImmortalSelectionService : IImmortalSelectionService OnChange -= action; } - public string GetFactionType() + public string GetFaction() { return _selectedFaction; } - public string GetImmortalType() + public string GetImmortal() { return _selectedImmortal; } - public bool SelectFactionType(string factionType) + public bool SelectFaction(string faction) { - if (_selectedFaction == factionType) return false; - _selectedFaction = factionType; + if (_selectedFaction == faction) return false; + _selectedFaction = faction; - if (_selectedFaction == FactionType.QRath) _selectedImmortal = DataType.IMMORTAL_Orzum; + if (_selectedFaction == DataType.FACTION_QRath) _selectedImmortal = DataType.IMMORTAL_Orzum; - if (_selectedFaction == FactionType.Aru) _selectedImmortal = DataType.IMMORTAL_Mala; + if (_selectedFaction == DataType.FACTION_Aru) _selectedImmortal = DataType.IMMORTAL_Mala; NotifyDataChanged(); return true; } - public bool SelectImmortalType(string immortalType) + public bool SelectImmortal(string immortal) { - if (_selectedImmortal == immortalType) return false; - _selectedImmortal = immortalType; + if (_selectedImmortal == immortal) return false; + _selectedImmortal = immortal; NotifyDataChanged(); return true; } + private void RefreshDefaults() + { + var foundFaction = _storageService.GetValue(StorageKeys.SelectedFaction); + var foundImmortal = _storageService.GetValue(StorageKeys.SelectedImmortal); + + if (foundFaction != null) _selectedFaction = foundFaction; + + if (foundImmortal != null) _selectedImmortal = foundImmortal; + + NotifyDataChanged(); + } + private event Action OnChange = null!; private void NotifyDataChanged() diff --git a/Services/Immortal/TimingService.cs b/Services/Immortal/TimingService.cs index d78914d..3f2453f 100644 --- a/Services/Immortal/TimingService.cs +++ b/Services/Immortal/TimingService.cs @@ -1,10 +1,27 @@ -namespace Services.Immortal; +using Services.Website; -public class TimingService : ITimingService +namespace Services.Immortal; + +public class TimingService : ITimingService, IDisposable { + private readonly IStorageService _storageService; private int attackTime = 1500; private int travelTime = 30; + public TimingService(IStorageService storageService) + { + _storageService = storageService; + + _storageService.Subscribe(RefreshDefaults); + + RefreshDefaults(); + } + + void IDisposable.Dispose() + { + _storageService.Unsubscribe(RefreshDefaults); + } + public void Subscribe(Action? action) { OnChange += action; @@ -15,6 +32,10 @@ public class TimingService : ITimingService OnChange -= action; } + public int BuildingInputDelay { get; set; } = 2; + public int WaitTime { get; set; } = 30; + public int WaitTo { get; set; } = 60; + public int GetAttackTime() { return attackTime; @@ -43,6 +64,29 @@ public class TimingService : ITimingService } } + private void RefreshDefaults() + { + //TODO Timing has changed in Storage + //TODO Timing has changed in itself + + var foundAttackTime = _storageService.GetValue(StorageKeys.AttackTime); + var foundTravelTime = _storageService.GetValue(StorageKeys.TravelTime); + + var foundBuildInputDefault = _storageService.GetValue(StorageKeys.BuildInputDelay); + + var foundWaitTime = _storageService.GetValue(StorageKeys.WaitTime); + var foundWaitTo = _storageService.GetValue(StorageKeys.WaitTo); + + if (foundAttackTime != null) attackTime = (int)foundAttackTime; + if (foundTravelTime != null) travelTime = (int)foundTravelTime; + + if (foundBuildInputDefault != null) BuildingInputDelay = (int)foundBuildInputDefault; + if (foundWaitTime != null) WaitTime = (int)foundWaitTime; + if (foundWaitTo != null) WaitTo = (int)foundWaitTo; + + NotifyDataChanged(); + } + private event Action? OnChange; private void NotifyDataChanged() diff --git a/Services/Services.csproj b/Services/Services.csproj index d10ad33..ee682d7 100644 --- a/Services/Services.csproj +++ b/Services/Services.csproj @@ -15,14 +15,14 @@ - - - - + + + + - + diff --git a/Services/Website/PermissionService.cs b/Services/Website/PermissionService.cs index 07c7755..b824dca 100644 --- a/Services/Website/PermissionService.cs +++ b/Services/Website/PermissionService.cs @@ -1,17 +1,14 @@ -using Blazored.LocalStorage; -using Microsoft.JSInterop; +using Microsoft.JSInterop; namespace Services.Website; public class PermissionService : IPermissionService { - private bool isLoaded; - - private IJSRuntime _jsRuntime; - private bool isStorageEnabled = false; + private readonly IStorageService _storageService; private IToastService _toastService; - private IStorageService _storageService; + private bool isLoaded; + private bool isStorageEnabled = false; public PermissionService(IJSRuntime jsRuntime, IToastService toastService, IStorageService storageService) { diff --git a/Services/Website/StorageService.cs b/Services/Website/StorageService.cs index 29fd007..8fcf939 100644 --- a/Services/Website/StorageService.cs +++ b/Services/Website/StorageService.cs @@ -1,5 +1,4 @@ using Blazored.LocalStorage; -using Microsoft.JSInterop; using Model.Feedback; namespace Services.Website; @@ -9,27 +8,30 @@ public class StorageKeys public static string EnabledStorage = "StorageEnabled"; public static string EnabledDataCollection = "StorageDataCollection"; public static string IsPlainView { get; set; } = "IsPlainView"; + public static string AttackTime { get; set; } = "AttackTime"; + public static string TravelTime { get; set; } = "TravelTime"; + public static string SelectedFaction { get; set; } = "SelectedFaction"; + public static string SelectedImmortal { get; set; } = "SelectedImmortal"; + public static string BuildInputDelay { get; set; } = "BuildInputDelay"; + public static string WaitTime { get; set; } = "WaitTime"; + + public static string WaitTo { get; set; } = "WaitTo"; } public class StorageService : IStorageService { private readonly ISyncLocalStorageService _localStorageService; - private IJSRuntime _jsRuntime; private readonly IToastService _toastService; private bool isLoaded; - private bool isStorageEnabled; - public StorageService(IJSRuntime jsRuntime, IToastService toastService, + public StorageService(IToastService toastService, ISyncLocalStorageService localStorageService) { - _jsRuntime = jsRuntime; _toastService = toastService; _localStorageService = localStorageService; } - private string enabledKey => StorageKeys.EnabledStorage; - public void Subscribe(Action action) { OnChange += action; @@ -51,12 +53,28 @@ public class StorageService : IStorageService { _localStorageService.SetItem(key, value); NotifyDataChanged(); + + _toastService.AddToast(new ToastModel + { + Title = "Test 1", + SeverityType = SeverityType.Error, + Message = "Storage must be enabled before Storage can be used." + }); + return; } if (key.Equals(StorageKeys.EnabledStorage)) { _localStorageService.Clear(); + + _toastService.AddToast(new ToastModel + { + Title = "Test 2", + SeverityType = SeverityType.Error, + Message = "Storage must be enabled before Storage can be used." + }); + NotifyDataChanged(); return; } @@ -78,29 +96,20 @@ public class StorageService : IStorageService NotifyDataChanged(); } - public async Task Load() + public Task Load() { - if (!isLoaded) return; + if (!isLoaded) return Task.CompletedTask; isLoaded = true; - isStorageEnabled = GetValue(enabledKey); - NotifyDataChanged(); + return Task.CompletedTask; } private event Action OnChange = null!; - private void NotifyDataChanged() { - try - { - - OnChange(); - } - catch (Exception e) - { - } + OnChange(); } } \ No newline at end of file