Rebornbuddy
Loading...
Searching...
No Matches
ff14bot.Managers.CapabilityManager Class Reference

Static Public Member Functions

static void Update (CapabilityManagerHandle handle, CapabilityFlags capability, Func< bool > condition, string reason=null)
static void Update (CapabilityManagerHandle handle, CapabilityFlags capability, int timeSpanMs, string reason=null)
static void Update (CapabilityManagerHandle handle, CapabilityFlags capability, TimeSpan timeSpan, string reason=null)
static void Pulse ()
 Performs maintenance operations for the internal capability conditions.
static void Clear (CapabilityFlags capabilities=CapabilityFlags.All, string reason=null)
 Clears all the entries that matches any of capabilities .
static void Clear (CapabilityManagerHandle handle, CapabilityFlags capabilities=CapabilityFlags.All, string reason=null)
static CapabilityManagerHandle CreateNewHandle ()
 Creates a new handle that can be used to add or update an entry.
static CapabilityManagerHandle Add (CapabilityFlags capability, Func< bool > condition, string reason=null)
static CapabilityManagerHandle Add (CapabilityFlags capability, int timeSpanMs, string reason=null)
static CapabilityManagerHandle Add (CapabilityFlags capability, TimeSpan timeSpan, string reason=null)

Detailed Description

This manager allows multiple sources to disallow a CombatRoutine capability for specific time or until a condition evaluates

to false and once no sources are disallowing a capability, that capability is then allowed

Member Function Documentation

◆ Add() [1/3]

CapabilityManagerHandle ff14bot.Managers.CapabilityManager.Add ( CapabilityFlags capability,
Func< bool > condition,
string reason = null )
static

Adds a new entry that disallows capability until

condition evaluates to false, at which

point the entry is removed and capability is allowed if

no other entries for capability are maintained.

Parameters
capabilityThe capability.
conditionThe condition.
reasonThe reason.
Returns
A handle that can be used to update the entry

◆ Add() [2/3]

CapabilityManagerHandle ff14bot.Managers.CapabilityManager.Add ( CapabilityFlags capability,
int timeSpanMs,
string reason = null )
static

Adds a new entry that disallows capability for

timeSpanMs duration in milliseconds, at which point the entry is removed and

capability is allowed if no other entries for capability are maintained.

Parameters
capabilityThe capability.
timeSpanMsThe timeSpanMs.
reasonThe reason.
Returns
A handle that can be used to update the entry
Exceptions
OverflowExceptiontimeSpanMs is less than F:System.TimeSpan.MinValue or greater than F:System.TimeSpan.MaxValue.-or-timeSpanMs is F:System.Double.PositiveInfinity.-or-timeSpanMs is F:System.Double.NegativeInfinity.

◆ Add() [3/3]

CapabilityManagerHandle ff14bot.Managers.CapabilityManager.Add ( CapabilityFlags capability,
TimeSpan timeSpan,
string reason = null )
static

Adds a new entry that disallows capability for

timeSpan duration, at which

point the entry is removed and capability is allowed if

no other entries for capability are maintained.

Parameters
capabilityThe capability.
timeSpanThe timeSpan.
reasonThe reason.
Returns
A handle that can be used to update the entry

◆ Clear() [1/2]

void ff14bot.Managers.CapabilityManager.Clear ( CapabilityFlags capabilities = CapabilityFlags::All,
string reason = null )
static

Clears all the entries that matches any of capabilities .

Parameters
capabilitiesThe capabilities.
reasonThe reason.

◆ Clear() [2/2]

void ff14bot.Managers.CapabilityManager.Clear ( CapabilityManagerHandle handle,
CapabilityFlags capabilities = CapabilityFlags::All,
string reason = null )
static

Clears all the entries that matches any of capabilities

and are associated with handle or all matching entries if handle is null.

Parameters
handleThe handle.
capabilitiesThe capabilities.
reasonThe reason.

◆ CreateNewHandle()

CapabilityManagerHandle ff14bot.Managers.CapabilityManager.CreateNewHandle ( )
static

Creates a new handle that can be used to add or update an entry.

◆ Pulse()

void ff14bot.Managers.CapabilityManager.Pulse ( )
static

Performs maintenance operations for the internal capability conditions.

This method iterates through all condition entries maintained by the capability manager, evaluates their respective conditions, and removes those entries whose conditions evaluate to false or are no longer valid. If all entries for a specific capability are cleared, the capability state is updated to indicate no active restrictions.

◆ Update() [1/3]

void ff14bot.Managers.CapabilityManager.Update ( CapabilityManagerHandle handle,
CapabilityFlags capability,
Func< bool > condition,
string reason = null )
static

Updates an entry (or adds a new one if entry is not present) to disallow

capability until condition evaluates

to false, at which point the entry is removed and capability

is allowed if no other entries for capability are maintained.

Parameters
handleThe handle.
capabilityThe capability.
conditionThe condition.
reasonThe reason.
Returns
A handle that can be used to update the entry
Exceptions
System.ArgumentNullExceptioncondition

◆ Update() [2/3]

void ff14bot.Managers.CapabilityManager.Update ( CapabilityManagerHandle handle,
CapabilityFlags capability,
int timeSpanMs,
string reason = null )
static

Updates an entry (or adds a new one if entry is not present) to disallow capability for

timeSpanMs duration in milliseconds. The entry is removed upon expiration and

capability is allowed if no other entries for capability are maintained.

Parameters
handleThe handle.
capabilityThe capability.
timeSpanMsThe timeSpanMs.
reasonThe reason.
Exceptions
OverflowExceptiontimeSpanMs is less than F:System.TimeSpan.MinValue or greater than F:System.TimeSpan.MaxValue.-or-timeSpanMs is F:System.Double.PositiveInfinity.-or-timeSpanMs is F:System.Double.NegativeInfinity.

◆ Update() [3/3]

void ff14bot.Managers.CapabilityManager.Update ( CapabilityManagerHandle handle,
CapabilityFlags capability,
TimeSpan timeSpan,
string reason = null )
static

Updates an entry (or adds a new one if entry is not present) to disallow capability for

timeSpan duration. The entry is removed upon expiration

and capability is allowed if

no other entries for capability are maintained.

Parameters
handleThe handle.
capabilityThe capability.
timeSpanThe timeSpan.
reasonThe reason.
Exceptions
ArgumentNullExceptionThe value of 'handle' cannot be null.