Vixen
c7401864
csharp
public readonly record struct GameplayEventFilter

Which events a subscriber wants: a verb, optionally a subject, a place and a tag query.

Read the guide page for this →

Remarks

This is what doc 28 means by "costs nothing when nothing dies". "Kill ten undead in Queensdale" is this struct — a verb range, a scene and a tag query — and matching it is a handful of integer comparisons against an event that was going to be posted anyway. There is no polling and no per-frame work for an objective nobody is progressing.

⚠ An empty verb range matches nothing, and that is the point. A filter is built from a name a designer wrote, and RangeOf answers an empty range for a name the content does not have. The other reading — empty means unfiltered — turns one typo in one objective into an objective that completes on the first thing that happens anywhere. Wanting every verb is EveryVerb, which is a thing a caller has to write down.

Fields and properties (7)

  • public GameplayTagRange Verb

    The verb prefix. EveryVerb for any.

  • public DefId Subject

    The exact subject, or None for any.

  • public DefId Scene

    The map, or None for anywhere.

  • public GameplayTagQuery? Tags

    A query over the subject's tags, or null for any.

  • public static GameplayTagRange EveryVerb

    The verb range that matches any verb at all. Written down, never defaulted to.

  • public static GameplayEventFilter Everything

    The filter that matches everything. What a logger or a recorder subscribes with.

  • public bool IsSome

    Whether this filter can ever match anything.

Methods (2)

Used by (8)

  • AchievementCriterionVixen.Gameplay.Collections
  • CollectionLibraryVixen.Gameplay.Collections
  • CollectionRecordVixen.Gameplay.Collections
  • EventBusTestsVixen.Gameplay.Quests.Tests
  • GameplayEventBusVixen.Gameplay
  • GameplayEventSubscriptionVixen.Gameplay
  • ObjectiveTemplateVixen.Gameplay.Quests
  • ObjectiveTrackerVixen.Gameplay.Quests