Interface IAgentLifecycle
This class provides events for in-game agent lifecycles.
Assembly: Dalamud.dll
public interface IAgentLifecycle : IDalamudService
Methods
RegisterListener(AgentEvent, IEnumerable<AgentId>, AgentEventDelegate)
Register a listener that will trigger on the specified event and any of the specified agent.
void RegisterListener(AgentEvent eventType, IEnumerable<AgentId> agentIds, IAgentLifecycle.AgentEventDelegate handler)
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Game.Agent.AgentEvent | eventType | Event type to trigger on. |
System.Collections.Generic.IEnumerable<Dalamud.Game.Agent.AgentId> | agentIds | Agent IDs that will trigger the handler to be invoked. |
| Dalamud.Plugin.Services.IAgentLifecycle.AgentEventDelegate | handler | The handler to invoke. |
RegisterListener(AgentEvent, AgentId, AgentEventDelegate)
Register a listener that will trigger on the specified event only for the specified agent.
void RegisterListener(AgentEvent eventType, AgentId agentId, IAgentLifecycle.AgentEventDelegate handler)
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Game.Agent.AgentEvent | eventType | Event type to trigger on. |
| Dalamud.Game.Agent.AgentId | agentId | The agent ID that will trigger the handler to be invoked. |
| Dalamud.Plugin.Services.IAgentLifecycle.AgentEventDelegate | handler | The handler to invoke. |
RegisterListener(AgentEvent, AgentEventDelegate)
Register a listener that will trigger on the specified event for any agent.
void RegisterListener(AgentEvent eventType, IAgentLifecycle.AgentEventDelegate handler)
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Game.Agent.AgentEvent | eventType | Event type to trigger on. |
| Dalamud.Plugin.Services.IAgentLifecycle.AgentEventDelegate | handler | The handler to invoke. |
UnregisterListener(AgentEvent, IEnumerable<AgentId>, AgentEventDelegate)
Unregister listener from specified event type and specified agent IDs.
void UnregisterListener(AgentEvent eventType, IEnumerable<AgentId> agentIds, IAgentLifecycle.AgentEventDelegate handler)
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Game.Agent.AgentEvent | eventType | Event type to deregister. |
System.Collections.Generic.IEnumerable<Dalamud.Game.Agent.AgentId> | agentIds | Agent IDs to deregister. |
| Dalamud.Plugin.Services.IAgentLifecycle.AgentEventDelegate | handler | Optional specific handler to remove. |
Remarks
If a specific handler is not provided, all handlers for the event type and agent IDs will be unregistered.
UnregisterListener(AgentEvent, AgentId, AgentEventDelegate)
Unregister all listeners for the specified event type and agent ID.
void UnregisterListener(AgentEvent eventType, AgentId agentId, IAgentLifecycle.AgentEventDelegate handler)
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Game.Agent.AgentEvent | eventType | Event type to deregister. |
| Dalamud.Game.Agent.AgentId | agentId | Agent id to deregister. |
| Dalamud.Plugin.Services.IAgentLifecycle.AgentEventDelegate | handler | Optional specific handler to remove. |
Remarks
If a specific handler is not provided, all handlers for the event type and agents will be unregistered.
UnregisterListener(AgentEvent, AgentEventDelegate)
Unregister an event type handler.
This will only remove a handler that is added via Dalamud.Plugin.Services.IAgentLifecycle.RegisterListener(Dalamud.Game.Agent.AgentEvent,Dalamud.Plugin.Services.IAgentLifecycle.AgentEventDelegate).
void UnregisterListener(AgentEvent eventType, IAgentLifecycle.AgentEventDelegate handler)
Parameters
| Type | Name | Description |
|---|---|---|
| Dalamud.Game.Agent.AgentEvent | eventType | Event type to deregister. |
| Dalamud.Plugin.Services.IAgentLifecycle.AgentEventDelegate | handler | Optional specific handler to remove. |
Remarks
If a specific handler is not provided, all handlers for the event type and agents will be unregistered.
UnregisterListener(params AgentEventDelegate[])
Unregister all events that use the specified handlers.
void UnregisterListener(params IAgentLifecycle.AgentEventDelegate[] handlers)
Parameters
| Type | Name | Description |
|---|---|---|
Dalamud.Plugin.Services.IAgentLifecycle.AgentEventDelegate[] | handlers | Handlers to remove. |
GetOriginalVirtualTable(nint)
Resolves an agents virtual table address back to the original unmodified table address.
nint GetOriginalVirtualTable(nint virtualTableAddress)
Returns
System.IntPtr: The address of the agents original virtual table.
Parameters
| Type | Name | Description |
|---|---|---|
System.IntPtr | virtualTableAddress | The address of a modified agents virtual table. |