Create GameStateRepository
Use GameState.apply() to build Projection Create GameEventHandler Add PlayerWinEvent
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user