From 88e992b0e94d92ac9ac26e8d2d72d818292841ca Mon Sep 17 00:00:00 2001 From: Joffrey Bion Date: Sun, 29 Mar 2020 18:08:49 +0200 Subject: Rename GameState -> TableState --- .../src/main/kotlin/org/luxons/sevenwonders/engine/Game.kt | 10 +++++----- .../kotlin/org/luxons/sevenwonders/engine/converters/Table.kt | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'sw-engine/src/main/kotlin/org') diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/Game.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/Game.kt index 931360d6..5a75516c 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/Game.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/Game.kt @@ -5,7 +5,7 @@ import org.luxons.sevenwonders.engine.boards.Table import org.luxons.sevenwonders.engine.cards.Card import org.luxons.sevenwonders.engine.cards.Decks import org.luxons.sevenwonders.engine.cards.Hands -import org.luxons.sevenwonders.engine.converters.toGameState +import org.luxons.sevenwonders.engine.converters.toTableState import org.luxons.sevenwonders.engine.converters.toPlayedMove import org.luxons.sevenwonders.engine.converters.toTableCard import org.luxons.sevenwonders.engine.data.LAST_AGE @@ -14,7 +14,7 @@ import org.luxons.sevenwonders.engine.moves.Move import org.luxons.sevenwonders.engine.moves.resolve import org.luxons.sevenwonders.engine.score.ScoreBoard import org.luxons.sevenwonders.model.Action -import org.luxons.sevenwonders.model.GameState +import org.luxons.sevenwonders.model.TableState import org.luxons.sevenwonders.model.PlayerMove import org.luxons.sevenwonders.model.PlayerTurnInfo import org.luxons.sevenwonders.model.cards.CardBack @@ -54,7 +54,7 @@ class Game internal constructor( return PlayerTurnInfo( playerIndex = player.index, - table = table.toGameState(), + table = table.toTableState(), action = action, hand = hand, preparedMove = preparedMoves[player.index]?.toPlayedMove(), @@ -107,7 +107,7 @@ class Game internal constructor( * had not prepared their moves (unless these players had nothing to do). To avoid this, please check if everyone * is ready using [allPlayersPreparedTheirMove]. */ - fun playTurn(): GameState { + fun playTurn(): TableState { makeMoves() if (endOfAgeReached()) { executeEndOfAgeEvents() @@ -118,7 +118,7 @@ class Game internal constructor( rotateHandsIfRelevant() startNewTurn() } - return table.toGameState() + return table.toTableState() } private fun makeMoves() { diff --git a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/converters/Table.kt b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/converters/Table.kt index 77843334..290b3dc9 100644 --- a/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/converters/Table.kt +++ b/sw-engine/src/main/kotlin/org/luxons/sevenwonders/engine/converters/Table.kt @@ -4,9 +4,9 @@ import org.luxons.sevenwonders.engine.SimplePlayer import org.luxons.sevenwonders.engine.moves.Move import org.luxons.sevenwonders.model.PlayedMove import org.luxons.sevenwonders.engine.boards.Table -import org.luxons.sevenwonders.model.GameState +import org.luxons.sevenwonders.model.TableState -internal fun Table.toGameState(): GameState = GameState( +internal fun Table.toTableState(): TableState = TableState( boards = boards.mapIndexed { i, b -> b.toApiBoard(SimplePlayer(i, this), lastPlayedMoves.getOrNull(i)) }, currentAge = currentAge, handRotationDirection = handRotationDirection, -- cgit