using Dalamud.Data;
using Dalamud.Game.ClientState.Objects;
using Dalamud.Game.ClientState.Objects.Types;
using Lumina.Excel;
namespace Dalamud.Game.ClientState.Statuses;
///
/// This class represents a status effect an actor is afflicted by.
///
public unsafe class Status
{
///
/// Initializes a new instance of the class.
///
/// Status address.
internal Status(IntPtr address)
{
this.Address = address;
}
///
/// Gets the address of the status in memory.
///
public IntPtr Address { get; }
///
/// Gets the status ID of this status.
///
public uint StatusId => this.Struct->StatusId;
///
/// Gets the GameData associated with this status.
///
public RowRef GameData => LuminaUtils.CreateRef(this.Struct->StatusId);
///
/// Gets the parameter value of the status.
///
public ushort Param => this.Struct->Param;
///
/// Gets the stack count of this status.
/// Only valid if this is a non-food status.
///
[Obsolete($"Replaced with {nameof(Param)}", true)]
public byte StackCount => (byte)this.Struct->Param;
///
/// Gets the time remaining of this status.
///
public float RemainingTime => this.Struct->RemainingTime;
///
/// Gets the source ID of this status.
///
public uint SourceId => this.Struct->SourceObject.ObjectId;
///
/// Gets the source actor associated with this status.
///
///
/// This iterates the actor table, it should be used with care.
///
public IGameObject? SourceObject => Service.Get().SearchById(this.SourceId);
private FFXIVClientStructs.FFXIV.Client.Game.Status* Struct => (FFXIVClientStructs.FFXIV.Client.Game.Status*)this.Address;
}