public sealed class GameplayEventBusWhere gameplay events are posted and where filters wait for them.
Remarks
In the kernel because both ends of every meeting are above it. Combat posts kills, crafting posts crafts, the economy posts purchases; quests, dynamic events and — when they are built — achievements and collections listen. Putting the bus in any one of those makes every other one depend on it, which is the horizontal edge doc 28's spine forbids.
⚠ Subscribing or cancelling during a dispatch is ordinary and is handled. It is not an edge case: the last kill of an objective completes a stage, which cancels that stage's subscriptions and takes out the next stage's — all inside the handler the bus is currently calling. So a cancellation during dispatch only clears a flag and the list is compacted afterwards, and a subscription made during dispatch is held aside until the dispatch ends.
⚠ A subscription made during a dispatch does not see the event being dispatched. The alternative is a stage that begins mid-event seeing the kill that ended the previous stage, which is one kill counted twice — and doc 28's quest property test is that no objective completes twice.
Delivery is in subscription order, so a replay of the same posts against the same subscriptions does the same things in the same order. Nothing here is randomised and nothing depends on a dictionary's enumeration.
Fields and properties (2)
public int CountHow many subscriptions are listening.
public ulong PostedHow many events have ever been posted. What an event id is seeded from.
Methods (4)
public GameplayEventSubscription Subscribe(GameplayEventFilter filter, GameplayEventCallback handler)Starts listening.
public bool Unsubscribe(GameplayEventSubscription? subscription)Stops a subscription listening.
public void Clear()Forgets every subscription.
public int Post(in GameplayEvent gameplayEvent)Tells everybody who wanted to know.
Used by (12)
- EventChainProjectionTestsVixen.Editor.Gameplay.Quests.Tests
- CollectionRecordVixen.Gameplay.Collections
- CollectionTestsVixen.Gameplay.Collections.Tests
- DynamicEventDirectorVixen.Gameplay.Quests
- DynamicEventInstanceVixen.Gameplay.Quests
- DynamicEventTestsVixen.Gameplay.Quests.Tests
- EventBusTestsVixen.Gameplay.Quests.Tests
- GameplayEventSubscriptionVixen.Gameplay
- ObjectiveTrackerVixen.Gameplay.Quests
- QuestJournalVixen.Gameplay.Quests
- QuestJournalTestsVixen.Gameplay.Quests.Tests
- QuestSectionTestsVixen.Live.Gameplay.Tests