diff --git a/IGP/Pages/Database/Entity/Parts/EntityVanguardsComponent.razor b/IGP/Pages/Database/Entity/Parts/EntityVanguardsComponent.razor index 260970b..1218255 100644 --- a/IGP/Pages/Database/Entity/Parts/EntityVanguardsComponent.razor +++ b/IGP/Pages/Database/Entity/Parts/EntityVanguardsComponent.razor @@ -10,8 +10,7 @@ var vanguardAdded = entity.VanguardAdded(); var replaced = EntityData.Get()[vanguardAdded.ReplaceId]; var immortal = EntityData.Get()[vanguardAdded.ImmortalId]; - - + var productionBuilding = (from building in requirements where building.Requirement == RequirementType.Production_Building select building).First().Id; diff --git a/Model/Entity/Data/EntityData.Building.cs b/Model/Entity/Data/EntityData.Building.cs index 203856b..8f27481 100644 --- a/Model/Entity/Data/EntityData.Building.cs +++ b/Model/Entity/Data/EntityData.Building.cs @@ -38,7 +38,7 @@ public partial class EntityData { Alloy = 450, BuildTime = 90, RequiresWorker = true, ConsumesWorker = true }) .AddPart(new EntityVitalityModel { Health = 2300, DefenseLayer = 1200, Armor = ArmorType.Heavy, IsStructure = true }) - .AddPart(new EntityHarvestModel + .AddPart(new EntityHarvesterModel { HarvestedPerInterval = 1, RequiresWorker = true, Resource = ResourceType.Alloy, Slots = 2, TotalAmount = 3600 @@ -61,7 +61,7 @@ public partial class EntityData Requirement = RequirementType.Morph }) .AddPart(new EntityProductionModel { Alloy = 400, BuildTime = 20, RequiresWorker = false }) - .AddPart(new EntityHarvestModel + .AddPart(new EntityHarvesterModel { HarvestedPerInterval = 1, RequiresWorker = true, Resource = ResourceType.Alloy, Slots = 4, TotalAmount = 3600 @@ -83,7 +83,7 @@ public partial class EntityData Requirement = RequirementType.Morph }) .AddPart(new EntityProductionModel { Alloy = 50, Cooldown = 50, RequiresWorker = false }) - .AddPart(new EntityHarvestModel + .AddPart(new EntityHarvesterModel { HarvestedPerInterval = 2, RequiresWorker = false, Resource = ResourceType.Ether, Slots = 1, TotalAmount = 100 @@ -105,7 +105,7 @@ public partial class EntityData Requirement = RequirementType.Morph }) .AddPart(new EntityProductionModel { Alloy = 50, Cooldown = 50, RequiresWorker = false }) - .AddPart(new EntityHarvestModel + .AddPart(new EntityHarvesterModel { HarvestedPerInterval = 2, RequiresWorker = false, Resource = ResourceType.Ether, Slots = 1, TotalAmount = 100 @@ -129,7 +129,7 @@ public partial class EntityData .AddPart(new EntityProductionModel { Alloy = 175, BuildTime = 30, RequiresWorker = true }) .AddPart(new EntityVitalityModel { Health = 300, DefenseLayer = 200, Armor = ArmorType.Heavy, IsStructure = true }) - .AddPart(new EntityHarvestModel + .AddPart(new EntityHarvesterModel { HarvestedPerInterval = 1.5625f, RequiresWorker = false, @@ -423,7 +423,7 @@ public partial class EntityData Health = 2000, DefenseLayer = 400, Defense = DefenseType.Overgrowth, Armor = ArmorType.Heavy, IsStructure = true }) - .AddPart(new EntityHarvestModel + .AddPart(new EntityHarvesterModel { HarvestedPerInterval = 1, RequiresWorker = true, Resource = ResourceType.Alloy, Slots = 2, TotalAmount = 3600 @@ -468,7 +468,7 @@ public partial class EntityData Requirement = RequirementType.Morph }) .AddPart(new EntityProductionModel { Alloy = 400, BuildTime = 20, RequiresWorker = false }) - .AddPart(new EntityHarvestModel + .AddPart(new EntityHarvesterModel { HarvestedPerInterval = 1, RequiresWorker = true, Resource = ResourceType.Alloy, Slots = 2, TotalAmount = 3600 @@ -494,7 +494,7 @@ public partial class EntityData .AddPart(new EntityProductionModel { Alloy = 225, BuildTime = 30, RequiresWorker = true }) .AddPart(new EntityVitalityModel { Health = 400, DefenseLayer = 225, Armor = ArmorType.Heavy, IsStructure = true }) - .AddPart(new EntityHarvestModel + .AddPart(new EntityHarvesterModel { HarvestedPerInterval = 1.5625f, RequiresWorker = false, Resource = ResourceType.Ether, Slots = 1, TotalAmount = 1200 diff --git a/Model/Entity/Data/EntityData.Immortal.cs b/Model/Entity/Data/EntityData.Immortal.cs index 2619694..22991f3 100644 --- a/Model/Entity/Data/EntityData.Immortal.cs +++ b/Model/Entity/Data/EntityData.Immortal.cs @@ -18,7 +18,7 @@ public partial class EntityData new EntityModel(DataType.IMMORTAL_Atzlan, EntityType.Immortal) .AddPart(new EntityInfoModel { Name = "Atzlan" }) .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) - .AddPart(new EntityHarvestModel + .AddPart(new EntityHarvesterModel { Resource = ResourceType.Pyre, HarvestedPerInterval = 1, HarvestDelay = 3, RequiresWorker = false, Slots = 1, TotalAmount = -1 @@ -37,7 +37,7 @@ public partial class EntityData new EntityModel(DataType.IMMORTAL_Mala, EntityType.Immortal) .AddPart(new EntityInfoModel { Name = "Mala" }) .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) - .AddPart(new EntityHarvestModel + .AddPart(new EntityHarvesterModel { Resource = ResourceType.Pyre, HarvestedPerInterval = 1, HarvestDelay = 3, RequiresWorker = false, Slots = 1, TotalAmount = -1 @@ -56,7 +56,7 @@ public partial class EntityData new EntityModel(DataType.IMMORTAL_Xol, EntityType.Immortal) .AddPart(new EntityInfoModel { Name = "Xol" }) .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) - .AddPart(new EntityHarvestModel + .AddPart(new EntityHarvesterModel { Resource = ResourceType.Pyre, HarvestedPerInterval = 1, HarvestDelay = 3, RequiresWorker = false, Slots = 1, TotalAmount = -1 @@ -77,7 +77,7 @@ public partial class EntityData new EntityModel(DataType.IMMORTAL_Ajari, EntityType.Immortal) .AddPart(new EntityInfoModel { Name = "Ajari" }) .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) - .AddPart(new EntityHarvestModel + .AddPart(new EntityHarvesterModel { Resource = ResourceType.Pyre, HarvestedPerInterval = 1, HarvestDelay = 3, RequiresWorker = false, Slots = 1, TotalAmount = -1 @@ -95,7 +95,7 @@ public partial class EntityData new EntityModel(DataType.IMMORTAL_Orzum, EntityType.Immortal) .AddPart(new EntityInfoModel { Name = "Orzum" }) .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) - .AddPart(new EntityHarvestModel + .AddPart(new EntityHarvesterModel { Resource = ResourceType.Pyre, HarvestedPerInterval = 1, HarvestDelay = 3, RequiresWorker = false, Slots = 1, TotalAmount = -1 diff --git a/Model/Entity/Data/EntityData.Map.cs b/Model/Entity/Data/EntityData.Map.cs new file mode 100644 index 0000000..243705b --- /dev/null +++ b/Model/Entity/Data/EntityData.Map.cs @@ -0,0 +1,170 @@ +using System.Collections.Generic; +using Model.Entity.Parts; +using Model.Types; + +namespace Model.Entity.Data; + +public partial class EntityData +{ + public static Dictionary GetMapData() + { + return new Dictionary + { + // Maps + //TODO I don't remember the map details, this data is wrong + { + DataType.MAP_Naginata, + new EntityModel(DataType.MAP_Naginata, EntityType.Map) + .AddPart(new EntityInfoModel + { + Name = "Naginata", Descriptive = DescriptiveType.Map, + Description = "" + }) + .AddPart(new EntityMapModel + { + PlayerCount = PlayerCountType.OneVsOne, + ResourcePlatforms = [ + DataType.MAPPLATFORM_Base, + DataType.MAPPLATFORM_Standard, + DataType.MAPPLATFORM_Standard, + DataType.MAPPLATFORM_Standard, + DataType.MAPPLATFORM_Standard, + DataType.MAPPLATFORM_Standard, + DataType.MAPPLATFORM_Standard, + ] + }) + }, + { + DataType.MAP_SummerPalace, + new EntityModel(DataType.MAP_SummerPalace, EntityType.Map) + .AddPart(new EntityInfoModel + { + Name = "Summer Palace", Descriptive = DescriptiveType.Map, + Description = "" + }) + .AddPart(new EntityMapModel + { + PlayerCount = PlayerCountType.OneVsOne, + ResourcePlatforms = [ + DataType.MAPPLATFORM_Base, + DataType.MAPPLATFORM_Standard, + DataType.MAPPLATFORM_Standard, + DataType.MAPPLATFORM_Standard, + DataType.MAPPLATFORM_Standard, + DataType.MAPPLATFORM_Standard, + DataType.MAPPLATFORM_Standard, + ] + }) + }, + { + DataType.MAPPLATFORM_Base, + new EntityModel(DataType.MAPPLATFORM_Base, EntityType.Map) + .AddPart(new EntityInfoModel + { + Name = "Base Map Platform", Descriptive = DescriptiveType.Map, + Description = "" + }) + .AddPart( + new EntityMapBasePlatformModel + { + ConnectedResourceNodes = + [ + DataType.RESOURCENODE_AlloyCitadel, + DataType.RESOURCENODE_Alloy, + DataType.RESOURCENODE_Ether, + DataType.RESOURCENODE_Ether + ] + }) + }, + { + DataType.MAPPLATFORM_Standard, + new EntityModel(DataType.MAPPLATFORM_Standard, EntityType.Map) + .AddPart(new EntityInfoModel + { + Name = "Standard Map Platform", Descriptive = DescriptiveType.Map, + Description = "" + }) + .AddPart( + new EntityMapBasePlatformModel + { + ConnectedResourceNodes = + [ + DataType.RESOURCENODE_Alloy, + DataType.RESOURCENODE_Ether + ] + }) + }, + + { + DataType.RESOURCENODE_AlloyBase, + new EntityModel(DataType.RESOURCENODE_AlloyBase, EntityType.Map) + .AddPart(new EntityInfoModel + { + Name = "Base Alloy", Descriptive = DescriptiveType.Map, + Description = "" + }) + .AddPart(new EntityResourceNodeAlloyModel + { + Resource = ResourceType.Alloy, + DefaultAmount = 6000 + }) + }, + { + DataType.RESOURCENODE_AlloyCitadel, + new EntityModel(DataType.RESOURCENODE_AlloyCitadel, EntityType.Map) + .AddPart(new EntityInfoModel + { + Name = "Citadel Alloy", Descriptive = DescriptiveType.Map, + Description = "" + }) + .AddPart(new EntityResourceNodeAlloyModel + { + Resource = ResourceType.Alloy, + DefaultAmount = 6000 + }) + }, + { + DataType.RESOURCENODE_Alloy, + new EntityModel(DataType.RESOURCENODE_Alloy, EntityType.Map) + .AddPart(new EntityInfoModel + { + Name = "Standard Alloy", Descriptive = DescriptiveType.Map, + Description = "" + }) + .AddPart(new EntityResourceNodeAlloyModel + { + Resource = ResourceType.Alloy, + DefaultAmount = 3600 + }) + }, + { + DataType.RESOURCENODE_Ether, + new EntityModel(DataType.RESOURCENODE_Ether, EntityType.Map) + .AddPart(new EntityInfoModel + { + Name = "Standard Ether", Descriptive = DescriptiveType.Map, + Description = "" + }) + .AddPart(new EntityResourceNodeAlloyModel + { + Resource = ResourceType.Ether, + DefaultAmount = 1200 + }) + }, + { + DataType.RESOURCENODE_Ether, + new EntityModel(DataType.RESOURCENODE_Ether, EntityType.Map) + .AddPart(new EntityInfoModel + { + Name = "Standard Ether", Descriptive = DescriptiveType.Map, + Description = "" + }) + .AddPart(new EntityResourceNodeAlloyModel + { + Resource = ResourceType.Ether, + DefaultAmount = 1200 + }) + } + }; + } +} \ No newline at end of file diff --git a/Model/Entity/Data/EntityData.Misc.cs b/Model/Entity/Data/EntityData.Misc.cs index 3bea4e1..9543b9a 100644 --- a/Model/Entity/Data/EntityData.Misc.cs +++ b/Model/Entity/Data/EntityData.Misc.cs @@ -258,7 +258,7 @@ public partial class EntityData Notes = "Revives in 40 seconds when destroyed." }) .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Neutral }) - .AddPart(new EntityHarvestModel + .AddPart(new EntityHarvesterModel { HarvestedPerInterval = 6, RequiresWorker = false, Resource = ResourceType.Alloy, Slots = 1, TotalAmount = 6000 @@ -298,7 +298,7 @@ public partial class EntityData .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) .AddPart(new EntityVitalityModel { Health = 2000, DefenseLayer = 400, Armor = ArmorType.Heavy, IsStructure = true }) - .AddPart(new EntityHarvestModel + .AddPart(new EntityHarvesterModel { HarvestedPerInterval = 1, RequiresWorker = true, Resource = ResourceType.Alloy, Slots = 6, TotalAmount = 6000 @@ -315,7 +315,7 @@ public partial class EntityData .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) .AddPart(new EntityVitalityModel { Health = 1600, DefenseLayer = 800, Armor = ArmorType.Heavy, IsStructure = true }) - .AddPart(new EntityHarvestModel + .AddPart(new EntityHarvesterModel { HarvestedPerInterval = 6, RequiresWorker = false, Resource = ResourceType.Alloy, Slots = 1, TotalAmount = 6000 diff --git a/Model/Entity/Data/EntityType.cs b/Model/Entity/Data/EntityType.cs index 363cd1d..0dc4654 100644 --- a/Model/Entity/Data/EntityType.cs +++ b/Model/Entity/Data/EntityType.cs @@ -19,6 +19,11 @@ public static class EntityType public static string Ability = "Ability"; public static string Tech = "Tech"; public static string Passive = "Passive"; + public static string Map = "Map"; + + + + public static string NotApplicable = "NotApplicable"; } public static class ImmortalSpellType diff --git a/Model/Entity/Data/Ids_Entity.cs b/Model/Entity/Data/Ids_Entity.cs index 8f60f95..fa2c46f 100644 --- a/Model/Entity/Data/Ids_Entity.cs +++ b/Model/Entity/Data/Ids_Entity.cs @@ -298,4 +298,18 @@ public static class DataType public static string UNIT_Thrum = nameof(UNIT_Thrum); public static string UNIT_Behemoth = "3783004b-65fd-4e4e-bef0-4cf161ea2d2d"; public static string SUMMON_Quitl = "d554fb2a-eec5-45fd-bf36-a52d51e615e2"; + + + //TODO I don't remember the maps + public static string MAP_Naginata = nameof(MAP_Naginata); + public static string MAP_SummerPalace = nameof(MAP_SummerPalace); + + public static string MAPPLATFORM_Base = nameof(MAPPLATFORM_Base); + public static string MAPPLATFORM_Standard = nameof(MAPPLATFORM_Standard); + + + public static string RESOURCENODE_AlloyBase = nameof(RESOURCENODE_AlloyBase); + public static string RESOURCENODE_Alloy = nameof(RESOURCENODE_Alloy); + public static string RESOURCENODE_AlloyCitadel = nameof(RESOURCENODE_AlloyCitadel); + public static string RESOURCENODE_Ether = nameof(RESOURCENODE_Ether); } \ No newline at end of file diff --git a/Model/Entity/EntityModel.cs b/Model/Entity/EntityModel.cs index 858ccfd..9559275 100644 --- a/Model/Entity/EntityModel.cs +++ b/Model/Entity/EntityModel.cs @@ -21,7 +21,7 @@ public class EntityModel private static Dictionary>? _entityModelsByHotkey; - public EntityModel(string data, string entity, bool isSpeculative = false) + public EntityModel(string data, string entity = "NotApplicable", bool isSpeculative = false) { DataType = data; EntityType = entity; @@ -255,9 +255,9 @@ public class EntityModel } - public EntityHarvestModel Harvest() + public EntityHarvesterModel Harvest() { - return (EntityHarvestModel)EntityParts.Find(x => x.GetType() == typeof(EntityHarvestModel))!; + return (EntityHarvesterModel)EntityParts.Find(x => x.GetType() == typeof(EntityHarvesterModel))!; } diff --git a/Model/Entity/Parts/EntityHarvestModel.cs b/Model/Entity/Parts/EntityHarvesterModel.cs similarity index 91% rename from Model/Entity/Parts/EntityHarvestModel.cs rename to Model/Entity/Parts/EntityHarvesterModel.cs index 5b7eb72..4018ce8 100644 --- a/Model/Entity/Parts/EntityHarvestModel.cs +++ b/Model/Entity/Parts/EntityHarvesterModel.cs @@ -2,7 +2,7 @@ namespace Model.Entity.Parts; -public class EntityHarvestModel : IEntityPartInterface +public class EntityHarvesterModel : IEntityPartInterface { public string Type { get; set; } = "EntityHarvestModel"; public ResourceType Resource { get; set; } = ResourceType.Alloy; @@ -12,7 +12,6 @@ public class EntityHarvestModel : IEntityPartInterface public int TotalAmount { get; set; } public bool RequiresWorker { get; set; } - public bool IsDepleted(float interval, float startedAt) { var lifeTime = interval - startedAt; diff --git a/Model/Entity/Parts/EntityMapBasePlatformModel.cs b/Model/Entity/Parts/EntityMapBasePlatformModel.cs new file mode 100644 index 0000000..fd3e75f --- /dev/null +++ b/Model/Entity/Parts/EntityMapBasePlatformModel.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; +using Model.Types; + +namespace Model.Entity.Parts; + +public class EntityMapBasePlatformModel : IEntityPartInterface +{ + public string Type { get; set; } = "EntityMapBasePlatformModel"; + + public List ConnectedResourceNodes { get; set; } = new(); + + + +} \ No newline at end of file diff --git a/Model/Entity/Parts/EntityMapModel.cs b/Model/Entity/Parts/EntityMapModel.cs new file mode 100644 index 0000000..a51c978 --- /dev/null +++ b/Model/Entity/Parts/EntityMapModel.cs @@ -0,0 +1,12 @@ +using System.Collections.Generic; +using Model.Types; + +namespace Model.Entity.Parts; + +public class EntityMapModel : IEntityPartInterface +{ + public string Type { get; set; } = "EntityMapModel"; + public string PlayerCount { get; set; } = "Two"; + + public List ResourcePlatforms { get; set; } = []; +} \ No newline at end of file diff --git a/Model/Entity/Parts/EntityResourceNodeAlloyModel.cs b/Model/Entity/Parts/EntityResourceNodeAlloyModel.cs new file mode 100644 index 0000000..40a3ed6 --- /dev/null +++ b/Model/Entity/Parts/EntityResourceNodeAlloyModel.cs @@ -0,0 +1,10 @@ +using Model.Types; + +namespace Model.Entity.Parts; + +public class EntityResourceNodeAlloyModel : IEntityPartInterface +{ + public string Type { get; set; } = "EntityResourceNodeAlloyModel"; + public ResourceType Resource { get; set; } = ResourceType.Alloy; + public int DefaultAmount { get; set; } +} \ No newline at end of file diff --git a/Model/Entity/Types/DescriptiveType.cs b/Model/Entity/Types/DescriptiveType.cs index 65eb359..96f3d81 100644 --- a/Model/Entity/Types/DescriptiveType.cs +++ b/Model/Entity/Types/DescriptiveType.cs @@ -24,6 +24,8 @@ public static class DescriptiveType public static string Summon = "Summon"; public static string Upgrade = "Upgrade"; public static string Ability = "Ability"; + + public static string Map = "Map"; public static string Passive = "Passive"; public static string Applies_Debuff = "Applies_Debuff"; diff --git a/Model/Entity/Types/PlayerCountType.cs b/Model/Entity/Types/PlayerCountType.cs new file mode 100644 index 0000000..4066579 --- /dev/null +++ b/Model/Entity/Types/PlayerCountType.cs @@ -0,0 +1,7 @@ +namespace Model.Types; + +public static class PlayerCountType +{ + public static string OneVsOne = "OneVsOne"; + public static string TwoVsTwo = "TwoVsTwo"; +} \ No newline at end of file