Skip to content

Commit

Permalink
Fix internal compiler error and compiler errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Zomis committed Jul 13, 2020
1 parent 29dc542 commit 63879e5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Expand Up @@ -126,7 +126,10 @@ class Server2(val events: EventSystem) {

features.add { feat, ev -> gameSystem.setup(feat, ev, config.idGenerator) { dbIntegration } }

dslGames.values.forEach { spec -> events.with(DslGameSystem(spec as GameSpec<Any>) { dbIntegration }::setup) }
dslGames.values.forEach { spec ->
val dslGameSystem = DslGameSystem(spec as GameSpec<Any>) { dbIntegration }
events.with(dslGameSystem::setup)
}

features.add(SimpleMatchMakingSystem()::setup)
events.with(ServerConsole()::register)
Expand Down
Expand Up @@ -238,7 +238,7 @@ class GameSystem(val gameClients: GameTypeMap<ClientList>, private val callback:
data class GameTypes(val gameTypes: MutableMap<String, GameType> = mutableMapOf())
private lateinit var features: Features

fun setup(features: Features, events: EventSystem, idGenerator: GameIdGenerator, dbIntegration: () -> DBIntegration?) {
fun setup(features: Features, events: EventSystem, idGenerator: GameIdGenerator, dbIntegration: () -> DBIntegration? = { null }) {
this.features = features
val gameTypes = features.addData(GameTypes())

Expand Down
Expand Up @@ -90,7 +90,7 @@ class LobbySystemTest {
moveHandler = {}
)
val inviteOptions = InviteOptions(false, InviteTurnOrder.ORDERED, -1, Unit, false)
val game = ServerGame(callback, GameType(callback, TestGames.gameTypeA as GameSpec<Any>, {null}, events, idGenerator), idGenerator(), inviteOptions)
val game = ServerGame(callback, GameType(callback, TestGames.gameTypeA as GameSpec<Any>, {null}, events, idGenerator, null), idGenerator(), inviteOptions)
game.players.add(clientAB2)
game.players.add(clientA1)
events.execute(GameStartedEvent(game))
Expand Down

0 comments on commit 63879e5

Please sign in to comment.