feat: implement 16 core event projections for domain events #322

Merged
freemo merged 3 commits from feature/m2-core-projections into master 2026-03-16 19:55:32 +00:00
Owner

Summary

  • Implements 8 projection classes handling 16 domain event types for the rendering pipeline
  • All projections are registered with ProjectionRegistry via CoreProjections.register_all
  • Includes comprehensive unit tests (48 scenarios) and integration tests (17 scenarios)

Changes

New Projection Classes

Projection Event Types
RoomProjection room_entered, entity_arrived, entity_departed
CommunicationProjection speech, whisper
StatsProjection stat_changed, health_changed
CombatProjection combat_start, combat_turn, combat_end
EnvironmentProjection time_advanced, weather_changed
InventoryProjection item_picked_up, item_dropped
ProgressionProjection skill_gained
SystemProjection system_message

Key Features

  • Multi-op events: RoomEntered produces text_append + map_refresh; CombatTurn produces text_append + bar_update; SkillGained produces text_append + overlay_show
  • Graceful edge case handling with nil/missing data fallbacks
  • Player-friendly formatted text output

Testing

  • Unit tests: tests/unit/core_projections.feature (48 scenarios)
  • Integration tests: tests/integration/core_projections_integration.feature (17 scenarios)

Closes #305

## Summary - Implements 8 projection classes handling 16 domain event types for the rendering pipeline - All projections are registered with ProjectionRegistry via CoreProjections.register_all - Includes comprehensive unit tests (48 scenarios) and integration tests (17 scenarios) ## Changes ### New Projection Classes | Projection | Event Types | |------------|-------------| | RoomProjection | room_entered, entity_arrived, entity_departed | | CommunicationProjection | speech, whisper | | StatsProjection | stat_changed, health_changed | | CombatProjection | combat_start, combat_turn, combat_end | | EnvironmentProjection | time_advanced, weather_changed | | InventoryProjection | item_picked_up, item_dropped | | ProgressionProjection | skill_gained | | SystemProjection | system_message | ### Key Features - Multi-op events: RoomEntered produces text_append + map_refresh; CombatTurn produces text_append + bar_update; SkillGained produces text_append + overlay_show - Graceful edge case handling with nil/missing data fallbacks - Player-friendly formatted text output ## Testing - Unit tests: `tests/unit/core_projections.feature` (48 scenarios) - Integration tests: `tests/integration/core_projections_integration.feature` (17 scenarios) Closes #305
Implements the RenderOp value object class for the UI render pipeline as
specified in issue #304. RenderOps are immutable value objects that describe
rendering instructions without specifying how they should be rendered.

Key features:
- Immutable value objects (frozen after creation) with type, window, and data
- Seven core RenderOp types: text_append, map_refresh, bar_update,
  prompt_update, window_clear, overlay_show, overlay_hide
- Factory methods for convenient construction: RenderOp.text_append(),
  RenderOp.bar_update(), etc.
- Data validation per type (required fields are enforced)
- Equality comparison support (== and hash for use as hash keys)
- to_h serialization for logging and debugging
- Comprehensive YARD documentation

Testing:
- 36 Cucumber scenarios covering all factory methods, immutability,
  validation, equality, and type constants
- 3 integration scenarios for realistic usage patterns

ISSUES CLOSED: #304
freemo force-pushed feature/m2-core-projections from 262728e1b4 to ae81ed3d7b 2026-03-16 16:57:18 +00:00 Compare
freemo force-pushed feature/m2-core-projections from ae81ed3d7b to 240fb1ea1e 2026-03-16 17:32:09 +00:00 Compare
freemo force-pushed feature/m2-core-projections from 240fb1ea1e to 38a588dd83 2026-03-16 19:55:24 +00:00 Compare
freemo merged commit 38a588dd83 into master 2026-03-16 19:55:32 +00:00
freemo deleted branch feature/m2-core-projections 2026-03-16 19:55:33 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: aethyr/Aethyr#322
No description provided.