diff options
author | jbion <joffrey.bion@amadeus.com> | 2019-02-27 01:29:47 +0100 |
---|---|---|
committer | jbion <joffrey.bion@amadeus.com> | 2019-02-27 01:29:47 +0100 |
commit | 7b53d62261b9e0fcddf4bd9e180e2ccdd25388ca (patch) | |
tree | 17136d4457d3282a39b4c17d53550f84ec6f6354 | |
parent | Fix imports (diff) | |
download | seven-wonders-7b53d62261b9e0fcddf4bd9e180e2ccdd25388ca.tar.gz seven-wonders-7b53d62261b9e0fcddf4bd9e180e2ccdd25388ca.tar.bz2 seven-wonders-7b53d62261b9e0fcddf4bd9e180e2ccdd25388ca.zip |
Remove unnecessary Jackson annotation on non-DTOs
-rw-r--r-- | backend/src/main/kotlin/org/luxons/sevenwonders/lobby/Lobby.kt | 2 | ||||
-rw-r--r-- | backend/src/main/kotlin/org/luxons/sevenwonders/lobby/Player.kt | 10 |
2 files changed, 2 insertions, 10 deletions
diff --git a/backend/src/main/kotlin/org/luxons/sevenwonders/lobby/Lobby.kt b/backend/src/main/kotlin/org/luxons/sevenwonders/lobby/Lobby.kt index 8498ce85..08249193 100644 --- a/backend/src/main/kotlin/org/luxons/sevenwonders/lobby/Lobby.kt +++ b/backend/src/main/kotlin/org/luxons/sevenwonders/lobby/Lobby.kt @@ -12,7 +12,7 @@ class Lobby( val id: Long, val name: String, var owner: Player, - @field:Transient private val gameDefinition: GameDefinition + private val gameDefinition: GameDefinition ) { private val players: MutableList<Player> = ArrayList(gameDefinition.maxPlayers) diff --git a/backend/src/main/kotlin/org/luxons/sevenwonders/lobby/Player.kt b/backend/src/main/kotlin/org/luxons/sevenwonders/lobby/Player.kt index 4f70468f..d6e9b344 100644 --- a/backend/src/main/kotlin/org/luxons/sevenwonders/lobby/Player.kt +++ b/backend/src/main/kotlin/org/luxons/sevenwonders/lobby/Player.kt @@ -1,6 +1,5 @@ package org.luxons.sevenwonders.lobby -import com.fasterxml.jackson.annotation.JsonIgnore import org.luxons.sevenwonders.errors.ApiMisuseException import org.luxons.sevenwonders.game.Game @@ -21,21 +20,16 @@ class Player( val isInGame: Boolean get() = _game != null - @Transient private var _lobby: Lobby? = null - @get:JsonIgnore val lobby: Lobby get() = _lobby ?: throw PlayerNotInLobbyException(username) - @get:JsonIgnore val ownedLobby: Lobby get() = if (isGameOwner) lobby else throw PlayerIsNotOwnerException(username) - @Transient private var _game: Game? = null - @get:JsonIgnore val game: Game get() = _game ?: throw PlayerNotInGameException(username) @@ -54,9 +48,7 @@ class Player( index = -1 } - override fun toString(): String { - return "'$displayName' ($username)" - } + override fun toString(): String = "'$displayName' ($username)" } internal class PlayerNotInLobbyException(username: String) : |