Table of Contents

Class TriggerExecution

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

Shared helpers for evaluating trigger conditions and executing trigger action lists. All helpers honor optional per-condition / per-action TargetSelector and TargetSelector fan-out.

public static class TriggerExecution
Inheritance
TriggerExecution
Inherited Members

Methods

AreConditionsMet(List<BaseCondition>, EventData, Func<BaseCondition, bool>)

Evaluates a condition list against the supplied event data, honoring per-condition TargetSelector fan-out. When filter is null, falls back to ConditionFilter so the same filter applied at the top level propagates into composites and selector-scoped condition lists.

public static bool AreConditionsMet(List<BaseCondition> conditions, EventData eventData, Func<BaseCondition, bool> filter = null)

Parameters

conditions List<BaseCondition>

The conditions to evaluate.

eventData EventData

The event data passed to each condition.

filter Func<BaseCondition, bool>

Optional explicit filter override (rarely needed — prefer setting ConditionFilter at the top of a trigger fire).

Returns

bool

True when every (non-skipped) condition passes; otherwise false.

EvaluateCondition(BaseCondition, EventData)

Evaluates a single condition, fanning out across TargetSelector when set and combining results per Combine.

public static bool EvaluateCondition(BaseCondition condition, EventData eventData)

Parameters

condition BaseCondition

The condition to evaluate.

eventData EventData

The event data passed to the condition.

Returns

bool

True when the condition is satisfied.

ExecuteActions(List<BaseAction>, EventData)

Executes an action list against the supplied event data, fanning out across per-action TargetSelector when set. Actions implementing IAbortableAction with StopChainOnFailure set will abort the rest of the chain when their TryExecute(ICharacter, EventData) returns false (e.g. a resource cost that couldn't be paid).

public static void ExecuteActions(List<BaseAction> actions, EventData eventData)

Parameters

actions List<BaseAction>

The actions to execute.

eventData EventData

The event data passed to each action.

RunInline(TargetSelector, List<BaseCondition>, List<BaseAction>, List<BaseAction>, EventData)

Shared selector-fanout + condition-branch helper used by both the asset-based Trigger and inline trigger types (e.g. WorldSceneTrigger). When selector is null the event data is processed as-is; otherwise the event is forked per selected target. For each scope conditions is evaluated and the matching action branch is dispatched. Centralising this loop keeps inline triggers in lock-step with future Trigger behaviour changes (fault isolation, ambient ConditionFilter, …).

public static void RunInline(TargetSelector selector, List<BaseCondition> conditions, List<BaseAction> onConditionsMetActions, List<BaseAction> onConditionsNotMetActions, EventData eventData)

Parameters

selector TargetSelector

Optional selector that fans the event out across multiple targets.

conditions List<BaseCondition>

Conditions that gate which action branch fires.

onConditionsMetActions List<BaseAction>

Actions to dispatch when conditions pass.

onConditionsNotMetActions List<BaseAction>

Actions to dispatch when conditions fail.

eventData EventData

The event data driving execution.