Table of Contents

Interface ICharacterAttributeController

Namespace
FishMMO.Shared.Core
Assembly
FishMMO.Shared.dll

Interface for character attribute controllers, providing access and management for all character attributes and resources. Used to read, modify, and synchronize attribute and resource values for a character.

public interface ICharacterAttributeController : ICharacterBehaviour
Inherited Members
Extension Methods

Properties

Attributes

Dictionary of all non-resource character attributes, keyed by template ID.

Dictionary<int, CharacterAttribute> Attributes { get; }

Property Value

Dictionary<int, CharacterAttribute>

IsPropagating

True while the attribute graph is propagating value changes. Notifications are deferred until propagation completes.

bool IsPropagating { get; }

Property Value

bool

ResourceAttributes

Dictionary of all resource character attributes (e.g., health, mana), keyed by template ID.

Dictionary<int, CharacterResourceAttribute> ResourceAttributes { get; }

Property Value

Dictionary<int, CharacterResourceAttribute>

Methods

AddAttribute(CharacterAttribute)

Adds a new non-resource attribute instance to the controller.

void AddAttribute(CharacterAttribute instance)

Parameters

instance CharacterAttribute

Attribute instance to add.

ApplyResourceState(CharacterAttributeResourceState)

Applies a resource state (health, mana, stamina, regen delta) to the controller.

void ApplyResourceState(CharacterAttributeResourceState resourceState)

Parameters

resourceState CharacterAttributeResourceState

Resource state to apply.

BeginNotificationSuppression()

Begins a scope that suppresses all attribute update notifications while still allowing deterministic attribute/resource state mutations to run. Used by prediction replay so UI, ECA, and passive listeners do not observe intermediate resimulation states.

void BeginNotificationSuppression()

BeginPropagation()

Begins a propagation batch. While active, EnqueueNotification(CharacterAttribute) collects changed attributes instead of firing events immediately. Must be paired with EndPropagation().

void BeginPropagation()

ClearModifierSource(ModifierSource)

Releases one contributor from every attribute on the sheet.

void ClearModifierSource(ModifierSource source)

Parameters

source ModifierSource

The contributor to release everywhere.

Remarks

For a source whose owner goes away without knowing which attributes it touched — see Region, which releases its own contributions when a character leaves it.

EndNotificationSuppression()

Ends a notification-suppression scope and discards any queued updates without invoking OnAttributeUpdated listeners.

void EndNotificationSuppression()

EndPropagation()

Ends a propagation batch. If this is the outermost batch (depth returns to zero), fires all deferred OnAttributeUpdated events.

void EndPropagation()

EnqueueNotification(CharacterAttribute)

Enqueues an attribute for deferred notification during propagation. If not propagating, callers should invoke the event directly instead.

void EnqueueNotification(CharacterAttribute attribute)

Parameters

attribute CharacterAttribute

The attribute to notify after propagation completes.

GetResourceState()

Gets the current resource state (health, mana, stamina, regen delta) for the controller.

CharacterAttributeResourceState GetResourceState()

Returns

CharacterAttributeResourceState

Current resource state struct.

Regenerate(uint)

Advances tick-driven regen for resource attributes (e.g., health, mana). A pulse fires when tick % regenTickInterval == 0; an internal monotonic guard prevents double-advancement under replay, resimulation, or future-state execution.

void Regenerate(uint tick)

Parameters

tick uint

Authoritative simulation tick for this replicate step.

SetAttribute(int, int, int?)

Sets the value and optional modifier of a non-resource attribute by template ID.

void SetAttribute(int id, int value, int? modifier = null)

Parameters

id int

Template ID of the attribute.

value int

New value to set.

modifier int?

Optional modifier value to set.

SetResourceAttribute(int, int, float, int?)

Sets the value, current value, and optional modifier of a resource attribute by template ID.

void SetResourceAttribute(int id, int value, float currentValue, int? modifier = null)

Parameters

id int

Template ID of the resource attribute.

value int

New value to set.

currentValue float

New current value to set.

modifier int?

Optional modifier value to set.

TryGetAttribute(CharacterAttributeTemplate, out CharacterAttribute)

Tries to get a non-resource attribute by template reference.

bool TryGetAttribute(CharacterAttributeTemplate template, out CharacterAttribute attribute)

Parameters

template CharacterAttributeTemplate

Attribute template to look up.

attribute CharacterAttribute

Out: found attribute instance.

Returns

bool

True if found, false otherwise.

TryGetAttribute(int, out CharacterAttribute)

Tries to get a non-resource attribute by template ID.

bool TryGetAttribute(int id, out CharacterAttribute attribute)

Parameters

id int

Template ID to look up.

attribute CharacterAttribute

Out: found attribute instance.

Returns

bool

True if found, false otherwise.

TryGetHealthAttribute(out CharacterResourceAttribute)

Tries to get the health resource attribute for the character.

bool TryGetHealthAttribute(out CharacterResourceAttribute health)

Parameters

health CharacterResourceAttribute

Out: found health resource attribute.

Returns

bool

True if found, false otherwise.

TryGetManaAttribute(out CharacterResourceAttribute)

Tries to get the mana resource attribute for the character.

bool TryGetManaAttribute(out CharacterResourceAttribute mana)

Parameters

mana CharacterResourceAttribute

Out: found mana resource attribute.

Returns

bool

True if found, false otherwise.

TryGetResourceAttribute(CharacterAttributeTemplate, out CharacterResourceAttribute)

Tries to get a resource attribute by template reference.

bool TryGetResourceAttribute(CharacterAttributeTemplate template, out CharacterResourceAttribute attribute)

Parameters

template CharacterAttributeTemplate

Resource attribute template to look up.

attribute CharacterResourceAttribute

Out: found resource attribute instance.

Returns

bool

True if found, false otherwise.

TryGetResourceAttribute(int, out CharacterResourceAttribute)

Tries to get a resource attribute by template ID.

bool TryGetResourceAttribute(int id, out CharacterResourceAttribute attribute)

Parameters

id int

Template ID to look up.

attribute CharacterResourceAttribute

Out: found resource attribute instance.

Returns

bool

True if found, false otherwise.

TryGetStaminaAttribute(out CharacterResourceAttribute)

Tries to get the stamina resource attribute for the character.

bool TryGetStaminaAttribute(out CharacterResourceAttribute stamina)

Parameters

stamina CharacterResourceAttribute

Out: found stamina resource attribute.

Returns

bool

True if found, false otherwise.