From b653a002381c664bd2e579b889ffdd6b322d66b3 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Sun, 27 Apr 2025 20:47:09 -0400 Subject: [PATCH] Add sorting, filtering, and new columns to WeaponTable Enhanced the `MudDataGrid` in `WeaponTable` by enabling multiple sorting and filtering while adding new "Faction" and "Immortal" columns. Extended `EntityModel` and `DATA` to support faction and immortal data for the table. Added "Neutral" faction and new entity "Pyre Miner" to the data model. --- IGP/PageLayout.razor | 1 + IGP/Pages/DataTables/Parts/WeaponTable.razor | 39 +++++++++++++++++++- Model/Entity/Data/DATA.cs | 23 +++++++++++- Model/Entity/EntityModel.cs | 12 ++++++ 4 files changed, 72 insertions(+), 3 deletions(-) diff --git a/IGP/PageLayout.razor b/IGP/PageLayout.razor index 042ba66..f90e0d8 100644 --- a/IGP/PageLayout.razor +++ b/IGP/PageLayout.razor @@ -11,6 +11,7 @@ + diff --git a/IGP/Pages/DataTables/Parts/WeaponTable.razor b/IGP/Pages/DataTables/Parts/WeaponTable.razor index bdd5177..e316081 100644 --- a/IGP/Pages/DataTables/Parts/WeaponTable.razor +++ b/IGP/Pages/DataTables/Parts/WeaponTable.razor @@ -1,15 +1,52 @@ 

WeaponTable

- + + + + +@{ + /** + + + + Periodic Elements + + + + + + + + + + + + + + + + + + +
+ Sort Name Column By Length +
+ */ +} + + + @code { List _entityWeapons; diff --git a/Model/Entity/Data/DATA.cs b/Model/Entity/Data/DATA.cs index 7e1dc9f..e9f1201 100644 --- a/Model/Entity/Data/DATA.cs +++ b/Model/Entity/Data/DATA.cs @@ -228,6 +228,16 @@ public class DATA 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" + }) + }, // Immortals // Aru { @@ -371,7 +381,6 @@ public class DATA Description = "Provides a fully upgraded base worth of alloy.", Notes = "Revives in 40 seconds when destroyed." }) - .AddPart(new EntityFactionModel { Faction = DataType.NEUTRAL_PyreCamp }) .AddPart(new EntityFactionModel { Faction = DataType.FACTION_Neutral }) .AddPart(new EntityHarvestModel { @@ -3637,7 +3646,17 @@ public class DATA }) .AddPart(new EntityVitalityModel { Health = 850, DefenseLayer = 200, Armor = ArmorType.Heavy, IsStructure = true }) - } + }, + { + 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/EntityModel.cs b/Model/Entity/EntityModel.cs index d1a94c6..20b371d 100644 --- a/Model/Entity/EntityModel.cs +++ b/Model/Entity/EntityModel.cs @@ -44,6 +44,18 @@ public class EntityModel var entityInfo = EntityParts.FirstOrDefault(a => a.GetType() == typeof(EntityInfoModel)) as EntityInfoModel; return entityInfo == null ? string.Empty : entityInfo.Name; } + + public string GetFaction() + { + var entityInfo = EntityParts.FirstOrDefault(a => a.GetType() == typeof(EntityFactionModel)) as EntityFactionModel; + return entityInfo == null ? string.Empty : DATA.Get()[entityInfo.Faction].GetName(); + } + + public string GetImmortal() + { + var entityInfo = EntityParts.FirstOrDefault(a => a.GetType() == typeof(EntityVanguardAddedModel)) as EntityVanguardAddedModel; + return entityInfo == null ? string.Empty : DATA.Get()[entityInfo.ImmortalId].GetName(); + } public string AsYaml() {