Skip to content

refactor: decouple match result announcement - #376

Merged
DevD4v3 merged 1 commit into
mainfrom
refactor/decouple-match-result-announcement
Aug 9, 2026
Merged

DevD4v3 merged 1 commit into
mainfrom
refactor/decouple-match-result-announcement

Conversation

@DevD4v3

@DevD4v3 DevD4v3 commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Motivation

MapRotationService was responsible for announcing match results in addition to coordinating map rotation.
This caused the map rotation logic to depend on MatchResult and presentation-specific message formatting.

The MatchResult domain model also contained an Announcement property solely for this presentation concern.
The match result should represent the outcome of the match without knowing how that result is presented to players.

The match result is announced when a new map begins loading, but MatchResultAnnouncer exposes Announce() to describe its actual responsibility rather than the event that triggers it. The map loading event is only the mechanism used to invoke the announcement.

Changes

  • Remove Announcement property from MatchResult.
  • Update MatchResultTests to remove presentation-specific assertions.
  • Remove the MatchResult dependency from MapRotationService.
  • Introduce MatchResultAnnouncer to handle match result presentation.
  • Expose MatchResultAnnouncer.Announce() as its public operation.
  • Subscribe MatchResultAnnouncer.Announce() to the MapRotationService.LoadingMapEvent event.

Benefits

  • MapRotationService is no longer coupled to match result presentation.
  • MatchResult now represents only the outcome of the match.
  • Match result presentation is encapsulated in MatchResultAnnouncer.
  • Presentation-specific messages are kept outside the domain model.

* Move match result presentation out of MatchResult and MapRotationService into MatchResultAnnouncer.

* Remove the presentation-specific Announcement property from MatchResult and update its tests accordingly.

* Register MatchResultAnnouncer with LoadingMapEvent so map rotation only signals that a new map is being loaded without knowing how the match result is presented.
@DevD4v3
DevD4v3 merged commit 5a305a5 into main Aug 9, 2026
4 checks passed
@DevD4v3
DevD4v3 deleted the refactor/decouple-match-result-announcement branch August 9, 2026 16:42
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.

1 participant