Skip to content

Add a mediator service for mods to communicate - #97

Merged
KlaasWhite merged 3 commits into
devfrom
feature/events
Oct 24, 2026
Merged

KlaasWhite merged 3 commits into
devfrom
feature/events

Conversation

@KlaasWhite

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Resolve the GetPublisher behavior or rename the API so repeated publisher access works as intended.

No open issues 🎉

What changed in this PR

This pull request adds a mediator service that enables mods to publish and subscribe to strongly typed events through the StarMap API.

Changes:

  • Registers mediator and mediation services with dependency injection.
  • Implements publisher registration, subscriptions, disposal, and sequential or parallel publishing.
  • Exposes public mediation interfaces and event contracts.
  • GetPublisher currently registers a new publisher on every call, preventing repeated access for the same event type; its behavior or naming should be corrected.
File Description
StarMap.Core/​StarMapCore.cs Registers mediator-related services with dependency injection.
StarMap.Core/​Services/​Mediator.cs Implements publisher registration, subscriptions, publishing, and disposal.
StarMap.Core/​API/​MediationService.cs Adapts the internal mediator to the public mod-facing service.
StarMap.API/​Services/​IMediationService.cs Defines the public mediation service contract.
StarMap.API/​Mediation/​ISubscription.cs Defines disposable event subscriptions.
StarMap.API/​Mediation/​IStarMapEvent.cs Defines the marker interface for StarMap events.
StarMap.API/​Mediation/​IEventPublisher.cs Defines sequential and parallel event publishing operations.

Review effort: Lite

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The changes require final human review because they are too complex or risky for automated approval.

No open issues 🎉

Review effort: Lite

@KlaasWhite
KlaasWhite merged commit 2bc1bc3 into dev Oct 24, 2026
2 checks passed
@KlaasWhite
KlaasWhite deleted the feature/events branch October 24, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants