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

dev.robocode.tankroyale.server.mapper.TeamMessageMapper.kt Maven / Gradle / Ivy

package dev.robocode.tankroyale.server.dev.robocode.tankroyale.server.mapper

import dev.robocode.tankroyale.server.model.BotId
import dev.robocode.tankroyale.server.model.TeamMessage

object TeamMessageMapper {

    fun map(teamMessages: List): List {
        val list = ArrayList()
        teamMessages.forEach { list.add(map(it)) }
        return list
    }

    fun map(teamMessage: dev.robocode.tankroyale.schema.game.TeamMessage): TeamMessage {
        teamMessage.apply {
            return TeamMessage(message, messageType, if (receiverId != null) BotId(receiverId) else null)
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy