From 79131084342ed054e814a0755dd670b6d605b7d5 Mon Sep 17 00:00:00 2001 From: Caraxi Date: Sat, 29 Aug 2020 14:42:35 +0930 Subject: [PATCH] Add EventObj MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ¯\_(ツ)_/¯ --- Dalamud/Game/ClientState/Actors/ActorTable.cs | 1 + .../Actors/Types/NonPlayer/EventObj.cs | 21 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 Dalamud/Game/ClientState/Actors/Types/NonPlayer/EventObj.cs diff --git a/Dalamud/Game/ClientState/Actors/ActorTable.cs b/Dalamud/Game/ClientState/Actors/ActorTable.cs index 9dd372ea1..048259ada 100644 --- a/Dalamud/Game/ClientState/Actors/ActorTable.cs +++ b/Dalamud/Game/ClientState/Actors/ActorTable.cs @@ -92,6 +92,7 @@ namespace Dalamud.Game.ClientState.Actors { return actorStruct.ObjectKind switch { ObjectKind.Player => new PlayerCharacter(offset, actorStruct, this.dalamud), ObjectKind.BattleNpc => new BattleNpc(offset, actorStruct, this.dalamud), + ObjectKind.EventObj => new EventObj(offset, actorStruct, this.dalamud), _ => new Actor(offset, actorStruct, this.dalamud) }; } diff --git a/Dalamud/Game/ClientState/Actors/Types/NonPlayer/EventObj.cs b/Dalamud/Game/ClientState/Actors/Types/NonPlayer/EventObj.cs new file mode 100644 index 000000000..265e80151 --- /dev/null +++ b/Dalamud/Game/ClientState/Actors/Types/NonPlayer/EventObj.cs @@ -0,0 +1,21 @@ +using System; + +namespace Dalamud.Game.ClientState.Actors.Types.NonPlayer { + /// + /// This class represents an EventObj. + /// + public class EventObj : Actor { + /// + /// Set up a new EventObj with the provided memory representation. + /// + /// The memory representation of the base actor. + /// A dalamud reference needed to access game data in Resolvers. + /// The address of this actor in memory. + public EventObj(IntPtr address, Structs.Actor actorStruct, Dalamud dalamud) : base(address, actorStruct, dalamud) { } + + /// + /// The data ID of the NPC linking to their respective game data. + /// + public int DataId => this.actorStruct.DataId; + } +}