public readonly record struct GameplayEventSomething happened: a kill, a pickup, a discovery, a purchase.
Remarks
The other half of doc 28's dependency spine. The spine says that where two features genuinely need to meet — loot dropping from a raid encounter, a quest counting a kill — they meet "through tags and events rather than through a reference". Tags were built in G0 and events were not, which left the sentence half true: a quest library that had to be told about kills by name would need a reference to combat, and the horizontal edge the spine forbids would be back.
A verb, a subject and a place, and nothing about who is watching. What makes the seam work is that a poster names what happened in its own vocabulary and never names an audience. Combat posts Event.Kill with the victim's tags; whether that advances a quest, an achievement, a dynamic event or nothing at all is not combat's business and it costs combat nothing when the answer is nothing.
⚠ Tags is borrowed for the duration of the dispatch and must not be kept. It is the subject's own live set — the victim's tags, the item's tags — passed by reference so that filtering a thousand kills allocates nothing. A subscriber that stored it would be holding a set that goes on changing, and for a corpse, one that is about to be recycled.
Fields and properties (6)
public GameplayTag VerbWhat happened — Event.Kill. The one field every filter tests first.
public DefId SubjectWhat it happened to or with: the creature, the item, the recipe, the currency.
public DefId SceneWhere, as a map's address. None for nowhere in particular.
public int AmountHow many or how much. One kill, thirty ore, five hundred gold.
public PlayerId InstigatorWho caused it, or None for the world itself.
public GameplayTagSet? TagsThe subject's tags, borrowed. Null when it has none.
Methods (1)
public GameplayEvent(GameplayTag Verb, DefId Subject = default(DefId), DefId Scene = default(DefId), int Amount = 1, PlayerId Instigator = default(PlayerId), GameplayTagSet? Tags = null)Something happened: a kill, a pickup, a discovery, a purchase.
Used by (10)
- CollectionRecordVixen.Gameplay.Collections
- CollectionTestsVixen.Gameplay.Collections.Tests
- ContentVixen.Gameplay.Quests.Tests
- DynamicEventTestsVixen.Gameplay.Quests.Tests
- EventBusTestsVixen.Gameplay.Quests.Tests
- GameplayEventBusVixen.Gameplay
- GameplayEventFilterVixen.Gameplay
- IQuestObjectiveVixen.Gameplay.Quests
- ObjectiveTrackerVixen.Gameplay.Quests
- QuestJournalTestsVixen.Gameplay.Quests.Tests