Rename Id fields to match CS names (#2405)

* Rename DataId to BaseId

* Fix obsoletes

* Inherit documentation
This commit is contained in:
Haselnussbomber 2025-09-29 18:06:28 +02:00 committed by GitHub
parent 9091216e1c
commit efaff769b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 49 additions and 57 deletions

View file

@ -19,8 +19,14 @@ public interface IBuddyMember
/// <summary>
/// Gets the object ID of this buddy.
/// </summary>
[Obsolete("Renamed to EntityId")]
uint ObjectId { get; }
/// <summary>
/// Gets the entity ID of this buddy.
/// </summary>
uint EntityId { get; }
/// <summary>
/// Gets the actor associated with this buddy.
/// </summary>
@ -83,6 +89,9 @@ internal unsafe class BuddyMember : IBuddyMember
/// <inheritdoc />
public uint ObjectId => this.Struct->EntityId;
/// <inheritdoc />
public uint EntityId => this.Struct->EntityId;
/// <inheritdoc />
public IGameObject? GameObject => this.objectTable.SearchById(this.ObjectId);

View file

@ -35,8 +35,14 @@ public interface IGameObject : IEquatable<IGameObject>
/// <summary>
/// Gets the data ID for linking to other respective game data.
/// </summary>
[Obsolete("Renamed to BaseId")]
public uint DataId { get; }
/// <summary>
/// Gets the base ID for linking to other respective game data.
/// </summary>
public uint BaseId { get; }
/// <summary>
/// Gets the ID of this GameObject's owner.
/// </summary>
@ -208,6 +214,9 @@ internal unsafe partial class GameObject : IGameObject
/// <inheritdoc/>
public uint DataId => this.Struct->BaseId;
/// <inheritdoc/>
public uint BaseId => this.Struct->BaseId;
/// <inheritdoc/>
public uint OwnerId => this.Struct->OwnerId;

View file

@ -40,8 +40,14 @@ public interface IPartyMember
/// <summary>
/// Gets the actor ID of this party member.
/// </summary>
[Obsolete("Renamed to EntityId")]
uint ObjectId { get; }
/// <summary>
/// Gets the entity ID of this party member.
/// </summary>
uint EntityId { get; }
/// <summary>
/// Gets the actor associated with this buddy.
/// </summary>
@ -115,87 +121,55 @@ internal unsafe class PartyMember : IPartyMember
this.Address = address;
}
/// <summary>
/// Gets the address of this party member in memory.
/// </summary>
/// <inheritdoc/>
public IntPtr Address { get; }
/// <summary>
/// Gets a list of buffs or debuffs applied to this party member.
/// </summary>
/// <inheritdoc/>
public StatusList Statuses => new(&this.Struct->StatusManager);
/// <summary>
/// Gets the position of the party member.
/// </summary>
/// <inheritdoc/>
public Vector3 Position => this.Struct->Position;
/// <summary>
/// Gets the content ID of the party member.
/// </summary>
/// <inheritdoc/>
public long ContentId => (long)this.Struct->ContentId;
/// <summary>
/// Gets the actor ID of this party member.
/// </summary>
/// <inheritdoc/>
public uint ObjectId => this.Struct->EntityId;
/// <summary>
/// Gets the actor associated with this buddy.
/// </summary>
/// <remarks>
/// This iterates the actor table, it should be used with care.
/// </remarks>
public IGameObject? GameObject => Service<ObjectTable>.Get().SearchById(this.ObjectId);
/// <inheritdoc/>
public uint EntityId => this.Struct->EntityId;
/// <summary>
/// Gets the current HP of this party member.
/// </summary>
/// <inheritdoc/>
public IGameObject? GameObject => Service<ObjectTable>.Get().SearchById(this.EntityId);
/// <inheritdoc/>
public uint CurrentHP => this.Struct->CurrentHP;
/// <summary>
/// Gets the maximum HP of this party member.
/// </summary>
/// <inheritdoc/>
public uint MaxHP => this.Struct->MaxHP;
/// <summary>
/// Gets the current MP of this party member.
/// </summary>
/// <inheritdoc/>
public ushort CurrentMP => this.Struct->CurrentMP;
/// <summary>
/// Gets the maximum MP of this party member.
/// </summary>
/// <inheritdoc/>
public ushort MaxMP => this.Struct->MaxMP;
/// <summary>
/// Gets the territory this party member is located in.
/// </summary>
/// <inheritdoc/>
public RowRef<Lumina.Excel.Sheets.TerritoryType> Territory => LuminaUtils.CreateRef<Lumina.Excel.Sheets.TerritoryType>(this.Struct->TerritoryType);
/// <summary>
/// Gets the World this party member resides in.
/// </summary>
/// <inheritdoc/>
public RowRef<Lumina.Excel.Sheets.World> World => LuminaUtils.CreateRef<Lumina.Excel.Sheets.World>(this.Struct->HomeWorld);
/// <summary>
/// Gets the displayname of this party member.
/// </summary>
/// <inheritdoc/>
public SeString Name => SeString.Parse(this.Struct->Name);
/// <summary>
/// Gets the sex of this party member.
/// </summary>
/// <inheritdoc/>
public byte Sex => this.Struct->Sex;
/// <summary>
/// Gets the classjob of this party member.
/// </summary>
/// <inheritdoc/>
public RowRef<Lumina.Excel.Sheets.ClassJob> ClassJob => LuminaUtils.CreateRef<Lumina.Excel.Sheets.ClassJob>(this.Struct->ClassJob);
/// <summary>
/// Gets the level of this party member.
/// </summary>
/// <inheritdoc/>
public byte Level => this.Struct->Level;
private FFXIVClientStructs.FFXIV.Client.Game.Group.PartyMember* Struct => (FFXIVClientStructs.FFXIV.Client.Game.Group.PartyMember*)this.Address;

View file

@ -40,7 +40,7 @@ internal class BuddyListWidget : IDataWindowWidget
}
else
{
ImGui.Text($"[Companion] {member.Address.ToInt64():X} - {member.ObjectId} - {member.DataID}");
ImGui.Text($"[Companion] {member.Address.ToInt64():X} - {member.EntityId} - {member.DataID}");
if (this.resolveGameData)
{
var gameObject = member.GameObject;
@ -64,7 +64,7 @@ internal class BuddyListWidget : IDataWindowWidget
}
else
{
ImGui.Text($"[Pet] {member.Address.ToInt64():X} - {member.ObjectId} - {member.DataID}");
ImGui.Text($"[Pet] {member.Address.ToInt64():X} - {member.EntityId} - {member.DataID}");
if (this.resolveGameData)
{
var gameObject = member.GameObject;
@ -91,7 +91,7 @@ internal class BuddyListWidget : IDataWindowWidget
for (var i = 0; i < count; i++)
{
var member = buddyList[i];
ImGui.Text($"[BattleBuddy] [{i}] {member?.Address.ToInt64():X} - {member?.ObjectId} - {member?.DataID}");
ImGui.Text($"[BattleBuddy] [{i}] {member?.Address.ToInt64():X} - {member?.EntityId} - {member?.DataID}");
if (this.resolveGameData)
{
var gameObject = member?.GameObject;

View file

@ -753,7 +753,7 @@ public static partial class Util
$"{actor.Address.ToInt64():X}:{actor.GameObjectId:X}[{tag}] - {actor.ObjectKind} - {actor.Name} - X{actor.Position.X} Y{actor.Position.Y} Z{actor.Position.Z} D{actor.YalmDistanceX} R{actor.Rotation} - Target: {actor.TargetObjectId:X}\n";
if (actor is Npc npc)
actorString += $" DataId: {npc.DataId} NameId:{npc.NameId}\n";
actorString += $" BaseId: {npc.BaseId} NameId:{npc.NameId}\n";
if (actor is ICharacter chara)
{
@ -787,7 +787,7 @@ public static partial class Util
$"{actor.Address.ToInt64():X}:{actor.GameObjectId:X}[{tag}] - {actor.ObjectKind} - {actor.Name} - X{actor.Position.X} Y{actor.Position.Y} Z{actor.Position.Z} D{actor.YalmDistanceX} R{actor.Rotation} - Target: {actor.TargetObjectId:X}\n";
if (actor is Npc npc)
actorString += $" DataId: {npc.DataId} NameId:{npc.NameId}\n";
actorString += $" BaseId: {npc.BaseId} NameId:{npc.NameId}\n";
if (actor is Character chara)
{