diff --git a/IGP/Pages/DataTables/Parts/WeaponTable.razor b/IGP/Pages/DataTables/Parts/WeaponTable.razor index 3165d10..bdd5177 100644 --- a/IGP/Pages/DataTables/Parts/WeaponTable.razor +++ b/IGP/Pages/DataTables/Parts/WeaponTable.razor @@ -1,11 +1,12 @@ 

WeaponTable

- + + diff --git a/Model/Entity/EntityModel.cs b/Model/Entity/EntityModel.cs index 46d8846..d1a94c6 100644 --- a/Model/Entity/EntityModel.cs +++ b/Model/Entity/EntityModel.cs @@ -38,6 +38,12 @@ public class EntityModel public bool IsSpeculative { get; set; } public string Descriptive { get; set; } = DescriptiveType.None; + + public string GetName() + { + var entityInfo = EntityParts.FirstOrDefault(a => a.GetType() == typeof(EntityInfoModel)) as EntityInfoModel; + return entityInfo == null ? string.Empty : entityInfo.Name; + } public string AsYaml() { @@ -63,6 +69,8 @@ public class EntityModel public EntityModel AddPart(IEntityPartInterface unitPart) { + unitPart.Parent = this; + EntityParts.Add(unitPart); return this; } diff --git a/Model/Entity/Parts/IEntityPartInterface.cs b/Model/Entity/Parts/IEntityPartInterface.cs index 833bc1f..43738b9 100644 --- a/Model/Entity/Parts/IEntityPartInterface.cs +++ b/Model/Entity/Parts/IEntityPartInterface.cs @@ -2,4 +2,5 @@ public class IEntityPartInterface { + public EntityModel Parent { get; set; } } \ No newline at end of file