Create GameStateRepository

Use GameState.apply() to build Projection
Create GameEventHandler
Add PlayerWinEvent
This commit is contained in:
2025-03-09 03:43:31 +01:00
parent 3080e515d6
commit 19e425d684
22 changed files with 371 additions and 81 deletions

View File

@@ -2,7 +2,9 @@ package eventDemo.configuration
import eventDemo.app.command.GameCommandHandler
import eventDemo.app.event.GameEventBus
import eventDemo.app.event.GameEventHandler
import eventDemo.app.event.GameEventStream
import eventDemo.app.event.projection.GameStateRepository
import eventDemo.app.eventListener.GameEventPlayerNotificationListener
import eventDemo.libs.event.EventBusInMemory
import eventDemo.libs.event.EventStreamInMemory
@@ -26,10 +28,16 @@ val appKoinModule =
GameEventBus(EventBusInMemory())
}
single {
GameEventStream(get(), EventStreamInMemory())
GameEventStream(EventStreamInMemory())
}
single {
GameCommandHandler(get())
GameStateRepository(get(), get())
}
single {
GameEventHandler(get(), get())
}
single {
GameCommandHandler(get(), get())
}
singleOf(::GameEventPlayerNotificationListener)

View File

@@ -5,6 +5,6 @@ import io.ktor.server.application.Application
import org.koin.ktor.ext.get
fun Application.configureGameListener() {
GameEventReactionListener(get(), get())
GameEventReactionListener(get(), get(), get())
.init()
}