All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.ro.dragossusi.sevens.ai.communication.LocalRoundedCommunication.kt Maven / Gradle / Ivy

There is a newer version: 1.3.0
Show newest version
package ro.dragossusi.sevens.ai.communication

import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.launch
import ro.dragossusi.sevens.ai.room.AiRoom
import ro.dragossusi.sevens.game.bridge.RoundedCommunication
import ro.dragossusi.sevens.game.listener.OnRoundEnded
import ro.dragossusi.sevens.game.listener.OnRoundStarted
import ro.dragossusi.sevens.game.listener.RoundedPlayerListener
import ro.dragossusi.sevens.game.room.RoundedRoom
import ro.dragossusi.sevens.game.round.Round
import ro.dragossusi.sevens.payload.Player

class LocalRoundedCommunication>(
    aiRoom: AiRoom,
    player: Player,
    dispatcher: CoroutineDispatcher,
    playerListener: L
) : LocalCommunication(
    aiRoom,
    player,
    dispatcher,
    playerListener
), RoundedCommunication {

    override var onRoundStarted: OnRoundStarted? = null
    override var onRoundEnded: OnRoundEnded? = null

    override fun endTurn() {
        launch {
            if (room.canEndTurn(playerSession))
                room.endTurn(playerSession)
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy