From cf3f6e647b3b638a0e6cf008fc6f10a417844fb4 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Sun, 22 Jun 2025 22:38:59 -0400 Subject: [PATCH] Web page data refactor --- IGP/PageLayout.razor | 51 ++-- Model/Entity/Data/EntityData.Misc.cs | 387 +++++++++++++++++++++++++++ Model/Entity/Data/EntityData.cs | 385 +------------------------- Model/Website/Data/EntityData.cs | 53 ++++ Model/Website/WebPageModel.cs | 7 +- Services/Website/WebsiteService.cs | 1 - 6 files changed, 462 insertions(+), 422 deletions(-) create mode 100644 Model/Entity/Data/EntityData.Misc.cs create mode 100644 Model/Website/Data/EntityData.cs diff --git a/IGP/PageLayout.razor b/IGP/PageLayout.razor index 9321d4e..8efc9f0 100644 --- a/IGP/PageLayout.razor +++ b/IGP/PageLayout.razor @@ -3,16 +3,15 @@ @inject IWebsiteService WebService @inject IDataCollectionService DataCollectionService @inject NavigationManager NavigationManager +@using Model.Website.Data @using Services.Website @implements IDisposable - - @@ -27,35 +26,16 @@ IGP Fan Reference - - - Build Calculator - - - - Harass Calculator - - - - Database - - - - - Data Tables - + @foreach (var page in WebsiteData.GetPages()) + { + + + @(page.Name) + + } @@ -64,11 +44,10 @@ - Build Calculator - Harass Calculator - Database - - + @foreach (var page in WebsiteData.GetPages()) + { + @(page.Name) + } diff --git a/Model/Entity/Data/EntityData.Misc.cs b/Model/Entity/Data/EntityData.Misc.cs new file mode 100644 index 0000000..3bea4e1 --- /dev/null +++ b/Model/Entity/Data/EntityData.Misc.cs @@ -0,0 +1,387 @@ +using System.Collections.Generic; +using Model.Entity.Parts; +using Model.Entity.Types; +using Model.Types; + +namespace Model.Entity.Data; + +public partial class EntityData +{ + public static Dictionary GetMiscData() + { + return new Dictionary + { + // Neutrals + + // Pyre Events + { + DataType.PYREEVENT_CampTaken, new EntityModel(DataType.PYREEVENT_CampTaken, EntityType.Pyre_Event) + .AddPart(new EntityInfoModel { Name = "Pyre Camp", Description = "Provides 25 when taken." }) + .AddPart(new EntityPyreRewardModel { BaseReward = 25 }) + .AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "2" }) + }, + { + DataType.PYREEVENT_MinerTaken, new EntityModel(DataType.PYREEVENT_MinerTaken, EntityType.Pyre_Event) + .AddPart(new EntityInfoModel { Name = "Pyre Camp", Description = "Provides 90 when taken." }) + .AddPart(new EntityPyreRewardModel + { BaseReward = 0, OverTimeRewardDuration = 90, OverTimeReward = 1 }) + .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "2" }) + }, + { + DataType.PYREEVENT_TowerKilled, new EntityModel(DataType.PYREEVENT_TowerKilled, EntityType.Pyre_Event) + .AddPart(new EntityInfoModel { Name = "Tower Taken", Description = "Provides 10 when destroyed." }) + .AddPart(new EntityPyreRewardModel { BaseReward = 10 }) + .AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "2" }) + }, + + // TEAPOTS + { + DataType.TEAPOT_Teapot, new EntityModel(DataType.TEAPOT_Teapot, EntityType.Teapot) + .AddPart(new EntityInfoModel + { + Name = "Teapot", Description = "Basic scout. Every faction has this", + Notes = @"Very powerful! So Fast" + }) + .AddPart(new EntityVitalityModel { Health = 120, Armor = ArmorType.Light }) + .AddPart(new EntityMovementModel { Speed = 400 }) + }, + { + DataType.TEAPOT_FlyingTeapot, new EntityModel(DataType.TEAPOT_FlyingTeapot, EntityType.Teapot) + .AddPart(new EntityInfoModel + { + Name = "Detector", + Description = "Has 1100 vision, and can see hidden units within 1000 range.", + Notes = @"Doesn't take up a scout slot." + }) + .AddPart(new EntityRequirementModel { Id = DataType.TEAPOT_Teapot }) + .AddPart(new EntitySupplyModel { Takes = 1 }) + .AddPart(new EntityProductionModel { Alloy = 100, Ether = 50 }) + .AddPart(new EntityVitalityModel { Health = 120, DefenseLayer = 80, Armor = ArmorType.Light }) + .AddPart(new EntityMovementModel { Speed = 280, Movement = MovementType.Air }) + .AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_Detection }) + }, + + // Families + { + DataType.FAMILY_Rae, + new EntityModel(DataType.FAMILY_Rae, EntityType.Family, true) + .AddPart(new EntityInfoModel + { + Name = "Rae" + }) + }, + { + DataType.FAMILY_Sylv, + new EntityModel(DataType.FAMILY_Sylv, EntityType.Family, true) + .AddPart(new EntityInfoModel + { + Name = "Sylv" + }) + }, + { + DataType.FAMILY_Angelic, + new EntityModel(DataType.FAMILY_Angelic, EntityType.Family, true) + .AddPart(new EntityInfoModel + { + Name = "Angelic" + }) + }, + { + DataType.FAMILY_Human, + new EntityModel(DataType.FAMILY_Human, EntityType.Family, true) + .AddPart(new EntityInfoModel + { + Name = "Human" + }) + }, + { + DataType.FAMILY_Coalition, + new EntityModel(DataType.FAMILY_Coalition, EntityType.Family, true) + .AddPart(new EntityInfoModel + { + Name = "Coalition?" + }) + }, + { + DataType.FAMILY_Demonic, + new EntityModel(DataType.FAMILY_Demonic, EntityType.Family, true) + .AddPart(new EntityInfoModel + { + Name = "Demonic?" + }) + }, + { + DataType.FAMILY_NazRa, + new EntityModel(DataType.FAMILY_NazRa, EntityType.Family, true) + .AddPart(new EntityInfoModel + { + Name = "Naz'Ra" + }) + }, + // Factions + // Sylv + { + DataType.FACTION_Aru, + new EntityModel(DataType.FACTION_Aru, EntityType.Faction) + .AddPart(new EntityInfoModel + { + Name = "Aru" + }) + .AddPart(new EntityPassiveModel + { + Name = "Overgrowth", + Description = + "Your units have an extra layer of health a regens rapidly when a unit hasn't been damaged recently. This regen is doubled on rootway." + }) + .AddPart(new EntityPassiveModel + { + Name = "Blood", + Description = + "Your casters passively get blood for spells. This blood regen rate is increased on rootway. Your casters can also spend their own life as blood. (Spending health as blood is currenly not in game.)" + }) + .AddPart(new EntityPassiveModel + { + Name = "Blood Wells", + Description = + "You can summon blood wells for pyre, that allow you to heal your units health and mana." + }) + }, + { + DataType.FACTION_Iratek, + new EntityModel(DataType.FACTION_Iratek, EntityType.Faction, true) + .AddPart(new EntityInfoModel + { + Name = "Iratek" + }) + }, + { + DataType.FACTION_Yul, + new EntityModel(DataType.FACTION_Yul, EntityType.Faction, true) + .AddPart(new EntityInfoModel { Name = "Yul" }) + }, + // Factions + // Angelic + { + DataType.FACTION_QRath, + new EntityModel(DataType.FACTION_QRath, EntityType.Faction) + .AddPart(new EntityInfoModel + { + Name = "Q'Rath", + Notes = + "Angelic faction that has adopted many humans into their ranks. They seek to bring more into their collective." + }) + .AddPart(new EntityPassiveModel + { + Name = "Wards", + Description = + "Your units have an extra layer of health that is always (but slowly) regenerates. The regeneration is double on Hallowed Ground." + }) + }, + { + DataType.FACTION_YRiah, + new EntityModel(DataType.FACTION_QRath, EntityType.Faction, true) + .AddPart(new EntityInfoModel { Name = "R'Raih" }) + }, + { + DataType.FACTION_ArkShai, + new EntityModel(DataType.FACTION_QRath, EntityType.Faction, true) + .AddPart(new EntityInfoModel + { Name = "Ark'Shai" }) + }, + // Factions + // Human + { + DataType.FACTION_Jora, + new EntityModel(DataType.FACTION_Jora, EntityType.Faction, true) + .AddPart(new EntityInfoModel { Name = "Jora" }) + }, + { + DataType.FACTION_Telmetra, + new EntityModel(DataType.FACTION_Telmetra, EntityType.Faction, true) + .AddPart(new EntityInfoModel { Name = "Talmetra" }) + }, + { + DataType.FACTION_Kjor, + new EntityModel(DataType.FACTION_Kjor, EntityType.Faction, true) + .AddPart(new EntityInfoModel + { Name = "Kjor" } + ) + }, + // Factions + // Rae + { + DataType.FACTION_Herlesh, + new EntityModel(DataType.FACTION_Herlesh, EntityType.Faction, true) + .AddPart(new EntityInfoModel { Name = "Herlesh" }) + }, + // Factions + // Coalition + { + DataType.FACTION_Khardu, + new EntityModel(DataType.FACTION_Khardu, EntityType.Faction, true) + .AddPart(new EntityInfoModel { Name = "Khardu" }) + }, + // Factions + // Neutral + { + DataType.FACTION_Neutral, + new EntityModel(DataType.FACTION_Neutral, EntityType.Faction) + .AddPart(new EntityInfoModel + { + Name = "Neutral" + }) + }, + + // Keys + { + DataType.COMMAND_Attack, + new EntityModel(DataType.COMMAND_Attack, EntityType.Command) + .AddPart(new EntityInfoModel + { Name = "Attack", Description = "Makes selected units attack targeted area." }) + .AddPart(new EntityHotkeyModel { Hotkey = "A", HotkeyGroup = "D" }) + }, + { + DataType.COMMAND_StandGround, + new EntityModel(DataType.COMMAND_StandGround, EntityType.Command) + .AddPart(new EntityInfoModel + { Name = "Stand Ground", Description = "Makes selected units stop moving." }) + .AddPart(new EntityHotkeyModel { Hotkey = "S", HotkeyGroup = "D" }) + }, + // Starting Structures + { + DataType.STARTING_Bastion, + new EntityModel(DataType.STARTING_Bastion, EntityType.Building) + .AddPart(new EntityInfoModel + { + Name = "Bastion", + Description = "Provides a fully upgraded base worth of alloy.", + Notes = "Revives in 40 seconds when destroyed." + }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Neutral }) + .AddPart(new EntityHarvestModel + { + HarvestedPerInterval = 6, RequiresWorker = false, Resource = ResourceType.Alloy, Slots = 1, + TotalAmount = 6000 + }) + .AddPart(new EntityVitalityModel { Health = 500, Armor = ArmorType.Heavy }) + .AddPart(new EntityWeaponModel + { Damage = 30, AttacksPerSecond = 1.401f, Targets = TargetType.All, Range = 700 }) + .AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_BastionPassives }) + }, + { + DataType.STARTING_Tower, + new EntityModel(DataType.STARTING_Tower, EntityType.Building) + .AddPart(new EntityInfoModel + { + Name = "Starting Tower", + Notes = "Currently not in game. Can be upgraded to the factions pyre tower." + }) + .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 + { + Damage = 20, Range = 800, AttacksPerSecond = 1.124f, Targets = TargetType.All, + MediumDamage = 25, HeavyDamage = 30 + }) + .AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_Respite }) + .AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_HallowedGround }) + }, + // Starting Structures + // Aru + { + DataType.STARTING_TownHall_Aru, + new EntityModel(DataType.STARTING_TownHall_Aru, EntityType.Building, true) + .AddPart(new EntityInfoModel + { Name = "Grove Heart (Starting)", Descriptive = DescriptiveType.TownHall_Starting }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) + .AddPart(new EntityVitalityModel + { Health = 2000, DefenseLayer = 400, Armor = ArmorType.Heavy, IsStructure = true }) + .AddPart(new EntityHarvestModel + { + HarvestedPerInterval = 1, RequiresWorker = true, Resource = ResourceType.Alloy, Slots = 6, + TotalAmount = 6000 + }) + .AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_Rootway }) + }, + // Starting Structures + // Q'Rath + { + DataType.STARTING_TownHall_QRath, + new EntityModel(DataType.STARTING_TownHall_QRath, EntityType.Building, true) + .AddPart(new EntityInfoModel + { Name = "Acropolis (Starting)", Descriptive = DescriptiveType.TownHall_Starting }) + .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) + .AddPart(new EntityVitalityModel + { Health = 1600, DefenseLayer = 800, Armor = ArmorType.Heavy, IsStructure = true }) + .AddPart(new EntityHarvestModel + { + HarvestedPerInterval = 6, RequiresWorker = false, Resource = ResourceType.Alloy, Slots = 1, + TotalAmount = 6000 + }) + .AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_HallowedGround }) + }, + + // Passives + // Neutral + + { + DataType.PASSIVE_Detection, + new EntityModel(DataType.PASSIVE_Detection, EntityType.Passive) + .AddPart(new EntityInfoModel + { + Name = "Detection", Descriptive = DescriptiveType.Passive, + Description = + @"Unit can see all hidden units in its detection radius." + }) + .AddPart(new EntityFactionModel { Faction = DataType.Any }) + }, + + { + DataType.PASSIVE_BastionPassives, + new EntityModel(DataType.PASSIVE_BastionPassives, EntityType.Passive) + .AddPart(new EntityInfoModel + { + Name = "(Scouts and Pyre)", Descriptive = DescriptiveType.Passive, + Description = + @"Bastion generates one scout in 2 minutes, up to a max of 2 scouts. And generates pyre over time." + }) + .AddPart(new EntityFactionModel { Faction = DataType.Any }) + }, + { + DataType.PASSIVE_Respite, + new EntityModel(DataType.PASSIVE_Respite, EntityType.Passive) + .AddPart(new EntityInfoModel + { + Name = "Respite", Descriptive = DescriptiveType.Passive, + Description = + @"Nearby units will slowly heal after not attacking or being attacked for 10 seconds." + }) + .AddPart(new EntityFactionModel { Faction = DataType.Any }) + }, + + { + DataType.PASSIVE_HarvestAlloy, + new EntityModel(DataType.PASSIVE_HarvestAlloy, EntityType.Passive) + .AddPart(new EntityInfoModel + { + Name = "Harvest Alloy", Descriptive = DescriptiveType.Passive, + Description = "This unit can harvest alloy." + }) + .AddPart(new EntityFactionModel { Faction = DataType.Any }) + }, + + { + DataType.NEUTRAL_PyreMiner, + new EntityModel(DataType.NEUTRAL_PyreMiner, EntityType.Building) + .AddPart(new EntityInfoModel + { + Name = "Pyre Miner", + Description = "Passively harvest pyre.", + Notes = "" + }) + } + }; + } +} \ No newline at end of file diff --git a/Model/Entity/Data/EntityData.cs b/Model/Entity/Data/EntityData.cs index b2ec11c..3e0f011 100644 --- a/Model/Entity/Data/EntityData.cs +++ b/Model/Entity/Data/EntityData.cs @@ -1,8 +1,5 @@ using System.Collections.Generic; using System.Linq; -using Model.Entity.Parts; -using Model.Entity.Types; -using Model.Types; using Newtonsoft.Json; namespace Model.Entity.Data; @@ -17,389 +14,13 @@ public partial class EntityData public static Dictionary Get() { - var entityModels = new Dictionary - { - // Neutrals - - // Pyre Events - { - DataType.PYREEVENT_CampTaken, new EntityModel(DataType.PYREEVENT_CampTaken, EntityType.Pyre_Event) - .AddPart(new EntityInfoModel { Name = "Pyre Camp", Description = "Provides 25 when taken." }) - .AddPart(new EntityPyreRewardModel { BaseReward = 25 }) - .AddPart(new EntityHotkeyModel { Hotkey = "E", HotkeyGroup = "2" }) - }, - { - DataType.PYREEVENT_MinerTaken, new EntityModel(DataType.PYREEVENT_MinerTaken, EntityType.Pyre_Event) - .AddPart(new EntityInfoModel { Name = "Pyre Camp", Description = "Provides 90 when taken." }) - .AddPart(new EntityPyreRewardModel - { BaseReward = 0, OverTimeRewardDuration = 90, OverTimeReward = 1 }) - .AddPart(new EntityHotkeyModel { Hotkey = "Q", HotkeyGroup = "2" }) - }, - { - DataType.PYREEVENT_TowerKilled, new EntityModel(DataType.PYREEVENT_TowerKilled, EntityType.Pyre_Event) - .AddPart(new EntityInfoModel { Name = "Tower Taken", Description = "Provides 10 when destroyed." }) - .AddPart(new EntityPyreRewardModel { BaseReward = 10 }) - .AddPart(new EntityHotkeyModel { Hotkey = "R", HotkeyGroup = "2" }) - }, - - // TEAPOTS - { - DataType.TEAPOT_Teapot, new EntityModel(DataType.TEAPOT_Teapot, EntityType.Teapot) - .AddPart(new EntityInfoModel - { - Name = "Teapot", Description = "Basic scout. Every faction has this", - Notes = @"Very powerful! So Fast" - }) - .AddPart(new EntityVitalityModel { Health = 120, Armor = ArmorType.Light }) - .AddPart(new EntityMovementModel { Speed = 400 }) - }, - { - DataType.TEAPOT_FlyingTeapot, new EntityModel(DataType.TEAPOT_FlyingTeapot, EntityType.Teapot) - .AddPart(new EntityInfoModel - { - Name = "Detector", - Description = "Has 1100 vision, and can see hidden units within 1000 range.", - Notes = @"Doesn't take up a scout slot." - }) - .AddPart(new EntityRequirementModel { Id = DataType.TEAPOT_Teapot }) - .AddPart(new EntitySupplyModel { Takes = 1 }) - .AddPart(new EntityProductionModel { Alloy = 100, Ether = 50 }) - .AddPart(new EntityVitalityModel { Health = 120, DefenseLayer = 80, Armor = ArmorType.Light }) - .AddPart(new EntityMovementModel { Speed = 280, Movement = MovementType.Air }) - .AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_Detection }) - }, - - // Families - { - DataType.FAMILY_Rae, - new EntityModel(DataType.FAMILY_Rae, EntityType.Family, true) - .AddPart(new EntityInfoModel - { - Name = "Rae" - }) - }, - { - DataType.FAMILY_Sylv, - new EntityModel(DataType.FAMILY_Sylv, EntityType.Family, true) - .AddPart(new EntityInfoModel - { - Name = "Sylv" - }) - }, - { - DataType.FAMILY_Angelic, - new EntityModel(DataType.FAMILY_Angelic, EntityType.Family, true) - .AddPart(new EntityInfoModel - { - Name = "Angelic" - }) - }, - { - DataType.FAMILY_Human, - new EntityModel(DataType.FAMILY_Human, EntityType.Family, true) - .AddPart(new EntityInfoModel - { - Name = "Human" - }) - }, - { - DataType.FAMILY_Coalition, - new EntityModel(DataType.FAMILY_Coalition, EntityType.Family, true) - .AddPart(new EntityInfoModel - { - Name = "Coalition?" - }) - }, - { - DataType.FAMILY_Demonic, - new EntityModel(DataType.FAMILY_Demonic, EntityType.Family, true) - .AddPart(new EntityInfoModel - { - Name = "Demonic?" - }) - }, - { - DataType.FAMILY_NazRa, - new EntityModel(DataType.FAMILY_NazRa, EntityType.Family, true) - .AddPart(new EntityInfoModel - { - Name = "Naz'Ra" - }) - }, - // Factions - // Sylv - { - DataType.FACTION_Aru, - new EntityModel(DataType.FACTION_Aru, EntityType.Faction) - .AddPart(new EntityInfoModel - { - Name = "Aru" - }) - .AddPart(new EntityPassiveModel - { - Name = "Overgrowth", - Description = - "Your units have an extra layer of health a regens rapidly when a unit hasn't been damaged recently. This regen is doubled on rootway." - }) - .AddPart(new EntityPassiveModel - { - Name = "Blood", - Description = - "Your casters passively get blood for spells. This blood regen rate is increased on rootway. Your casters can also spend their own life as blood. (Spending health as blood is currenly not in game.)" - }) - .AddPart(new EntityPassiveModel - { - Name = "Blood Wells", - Description = - "You can summon blood wells for pyre, that allow you to heal your units health and mana." - }) - }, - { - DataType.FACTION_Iratek, - new EntityModel(DataType.FACTION_Iratek, EntityType.Faction, true) - .AddPart(new EntityInfoModel - { - Name = "Iratek" - }) - }, - { - DataType.FACTION_Yul, - new EntityModel(DataType.FACTION_Yul, EntityType.Faction, true) - .AddPart(new EntityInfoModel { Name = "Yul" }) - }, - // Factions - // Angelic - { - DataType.FACTION_QRath, - new EntityModel(DataType.FACTION_QRath, EntityType.Faction) - .AddPart(new EntityInfoModel - { - Name = "Q'Rath", - Notes = - "Angelic faction that has adopted many humans into their ranks. They seek to bring more into their collective." - }) - .AddPart(new EntityPassiveModel - { - Name = "Wards", - Description = - "Your units have an extra layer of health that is always (but slowly) regenerates. The regeneration is double on Hallowed Ground." - }) - }, - { - DataType.FACTION_YRiah, - new EntityModel(DataType.FACTION_QRath, EntityType.Faction, true) - .AddPart(new EntityInfoModel { Name = "R'Raih" }) - }, - { - DataType.FACTION_ArkShai, - new EntityModel(DataType.FACTION_QRath, EntityType.Faction, true) - .AddPart(new EntityInfoModel - { Name = "Ark'Shai" }) - }, - // Factions - // Human - { - DataType.FACTION_Jora, - new EntityModel(DataType.FACTION_Jora, EntityType.Faction, true) - .AddPart(new EntityInfoModel { Name = "Jora" }) - }, - { - DataType.FACTION_Telmetra, - new EntityModel(DataType.FACTION_Telmetra, EntityType.Faction, true) - .AddPart(new EntityInfoModel { Name = "Talmetra" }) - }, - { - DataType.FACTION_Kjor, - new EntityModel(DataType.FACTION_Kjor, EntityType.Faction, true) - .AddPart(new EntityInfoModel - { Name = "Kjor" } - ) - }, - // Factions - // Rae - { - DataType.FACTION_Herlesh, - new EntityModel(DataType.FACTION_Herlesh, EntityType.Faction, true) - .AddPart(new EntityInfoModel { Name = "Herlesh" }) - }, - // Factions - // Coalition - { - DataType.FACTION_Khardu, - new EntityModel(DataType.FACTION_Khardu, EntityType.Faction, true) - .AddPart(new EntityInfoModel { Name = "Khardu" }) - }, - // Factions - // Neutral - { - DataType.FACTION_Neutral, - new EntityModel(DataType.FACTION_Neutral, EntityType.Faction) - .AddPart(new EntityInfoModel - { - Name = "Neutral" - }) - }, - - // Keys - { - DataType.COMMAND_Attack, - new EntityModel(DataType.COMMAND_Attack, EntityType.Command) - .AddPart(new EntityInfoModel - { Name = "Attack", Description = "Makes selected units attack targeted area." }) - .AddPart(new EntityHotkeyModel { Hotkey = "A", HotkeyGroup = "D" }) - }, - { - DataType.COMMAND_StandGround, - new EntityModel(DataType.COMMAND_StandGround, EntityType.Command) - .AddPart(new EntityInfoModel - { Name = "Stand Ground", Description = "Makes selected units stop moving." }) - .AddPart(new EntityHotkeyModel { Hotkey = "S", HotkeyGroup = "D" }) - }, - // Starting Structures - { - DataType.STARTING_Bastion, - new EntityModel(DataType.STARTING_Bastion, EntityType.Building) - .AddPart(new EntityInfoModel - { - Name = "Bastion", - Description = "Provides a fully upgraded base worth of alloy.", - Notes = "Revives in 40 seconds when destroyed." - }) - .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Neutral }) - .AddPart(new EntityHarvestModel - { - HarvestedPerInterval = 6, RequiresWorker = false, Resource = ResourceType.Alloy, Slots = 1, - TotalAmount = 6000 - }) - .AddPart(new EntityVitalityModel { Health = 500, Armor = ArmorType.Heavy }) - .AddPart(new EntityWeaponModel - { Damage = 30, AttacksPerSecond = 1.401f, Targets = TargetType.All, Range = 700 }) - .AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_BastionPassives }) - }, - { - DataType.STARTING_Tower, - new EntityModel(DataType.STARTING_Tower, EntityType.Building) - .AddPart(new EntityInfoModel - { - Name = "Starting Tower", - Notes = "Currently not in game. Can be upgraded to the factions pyre tower." - }) - .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 - { - Damage = 20, Range = 800, AttacksPerSecond = 1.124f, Targets = TargetType.All, - MediumDamage = 25, HeavyDamage = 30 - }) - .AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_Respite }) - .AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_HallowedGround }) - }, - // Starting Structures - // Aru - { - DataType.STARTING_TownHall_Aru, - new EntityModel(DataType.STARTING_TownHall_Aru, EntityType.Building, true) - .AddPart(new EntityInfoModel - { Name = "Grove Heart (Starting)", Descriptive = DescriptiveType.TownHall_Starting }) - .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Aru }) - .AddPart(new EntityVitalityModel - { Health = 2000, DefenseLayer = 400, Armor = ArmorType.Heavy, IsStructure = true }) - .AddPart(new EntityHarvestModel - { - HarvestedPerInterval = 1, RequiresWorker = true, Resource = ResourceType.Alloy, Slots = 6, - TotalAmount = 6000 - }) - .AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_Rootway }) - }, - // Starting Structures - // Q'Rath - { - DataType.STARTING_TownHall_QRath, - new EntityModel(DataType.STARTING_TownHall_QRath, EntityType.Building, true) - .AddPart(new EntityInfoModel - { Name = "Acropolis (Starting)", Descriptive = DescriptiveType.TownHall_Starting }) - .AddPart(new EntityFactionModel { Faction = DataType.FACTION_QRath }) - .AddPart(new EntityVitalityModel - { Health = 1600, DefenseLayer = 800, Armor = ArmorType.Heavy, IsStructure = true }) - .AddPart(new EntityHarvestModel - { - HarvestedPerInterval = 6, RequiresWorker = false, Resource = ResourceType.Alloy, Slots = 1, - TotalAmount = 6000 - }) - .AddPart(new EntityIdPassiveModel { Id = DataType.PASSIVE_HallowedGround }) - }, - - // Passives - // Neutral - - { - DataType.PASSIVE_Detection, - new EntityModel(DataType.PASSIVE_Detection, EntityType.Passive) - .AddPart(new EntityInfoModel - { - Name = "Detection", Descriptive = DescriptiveType.Passive, - Description = - @"Unit can see all hidden units in its detection radius." - }) - .AddPart(new EntityFactionModel { Faction = DataType.Any }) - }, - - { - DataType.PASSIVE_BastionPassives, - new EntityModel(DataType.PASSIVE_BastionPassives, EntityType.Passive) - .AddPart(new EntityInfoModel - { - Name = "(Scouts and Pyre)", Descriptive = DescriptiveType.Passive, - Description = - @"Bastion generates one scout in 2 minutes, up to a max of 2 scouts. And generates pyre over time." - }) - .AddPart(new EntityFactionModel { Faction = DataType.Any }) - }, - { - DataType.PASSIVE_Respite, - new EntityModel(DataType.PASSIVE_Respite, EntityType.Passive) - .AddPart(new EntityInfoModel - { - Name = "Respite", Descriptive = DescriptiveType.Passive, - Description = - @"Nearby units will slowly heal after not attacking or being attacked for 10 seconds." - }) - .AddPart(new EntityFactionModel { Faction = DataType.Any }) - }, - - { - DataType.PASSIVE_HarvestAlloy, - new EntityModel(DataType.PASSIVE_HarvestAlloy, EntityType.Passive) - .AddPart(new EntityInfoModel - { - Name = "Harvest Alloy", Descriptive = DescriptiveType.Passive, - Description = "This unit can harvest alloy." - }) - .AddPart(new EntityFactionModel { Faction = DataType.Any }) - }, - - { - DataType.NEUTRAL_PyreMiner, - new EntityModel(DataType.NEUTRAL_PyreMiner, EntityType.Building) - .AddPart(new EntityInfoModel - { - Name = "Pyre Miner", - Description = "Passively harvest pyre.", - Notes = "" - }) - } - }; - return entityModels - .Concat(GetResearchData()) + return GetResearchData() .Concat(GetArmyData()) .Concat(GetAbilityData()) + .Concat(GetMiscData()) .Concat(GetImmortalData()) .Concat(GetBuildingData()) .Concat(GetPassiveData()) - .ToDictionary( - a => a.Key, - a => a.Value); + .ToDictionary(); } } \ No newline at end of file diff --git a/Model/Website/Data/EntityData.cs b/Model/Website/Data/EntityData.cs new file mode 100644 index 0000000..b9b0b20 --- /dev/null +++ b/Model/Website/Data/EntityData.cs @@ -0,0 +1,53 @@ +using System.Collections.Generic; + +namespace Model.Website.Data; + +public class WebsiteData +{ + public static List GetPages() + { + return + [ + new WebPageModel + { + Id = 2, + WebSectionModelId = 2, + Name = "Build Calculator", + Description = "Build order calculator for determining army timings", + Href = "build-calculator", + IsPrivate = "False", + Icon = "fa-solid fa-helmet-battle" + }, + new WebPageModel + { + Id = 1, + WebSectionModelId = 2, + Name = "Database", + Description = "Database of game information", + Href = "database", + IsPrivate = "False", + Icon = "fa-solid fa-clipboard-list" + }, + new WebPageModel + { + Id = 3, + WebSectionModelId = 2, + Name = "Harass Calculator", + Description = "Database of game information", + Href = "database", + IsPrivate = "False", + Icon = "fa-solid fa-bow-arrow" + }, + new WebPageModel + { + Id = 4, + WebSectionModelId = 2, + Name = "Data Tables", + Description = "Data tables", + Href = "data-tables", + IsPrivate = "False", + Icon = "fa-solid fa-table-list" + } + ]; + } +} \ No newline at end of file diff --git a/Model/Website/WebPageModel.cs b/Model/Website/WebPageModel.cs index 19e9cfb..5c31f8d 100644 --- a/Model/Website/WebPageModel.cs +++ b/Model/Website/WebPageModel.cs @@ -2,10 +2,11 @@ public class WebPageModel { - public int Id { get; set; } - public int? WebSectionModelId { get; set; } + public int Id { get; set; } // Not used + public int? WebSectionModelId { get; set; } // Not used public string Name { get; set; } = "Add name"; public string Description { get; set; } = "Add description"; public string Href { get; set; } = null; - public string IsPrivate { get; set; } = "True"; + public string IsPrivate { get; set; } = "True"; // Not used. Make boolean + public string Icon { get; set; } } \ No newline at end of file diff --git a/Services/Website/WebsiteService.cs b/Services/Website/WebsiteService.cs index 72f22cd..16c050b 100644 --- a/Services/Website/WebsiteService.cs +++ b/Services/Website/WebsiteService.cs @@ -55,7 +55,6 @@ public class WebsiteService : IWebsiteService NotifyDataChanged(); } - private event Action OnChange = default!; private void SortSql()