aboutsummaryrefslogtreecommitdiff
path: root/src/scalevalapokalypsi/Client/Client.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/scalevalapokalypsi/Client/Client.scala')
-rw-r--r--src/scalevalapokalypsi/Client/Client.scala9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/scalevalapokalypsi/Client/Client.scala b/src/scalevalapokalypsi/Client/Client.scala
index e94fdb0..5364405 100644
--- a/src/scalevalapokalypsi/Client/Client.scala
+++ b/src/scalevalapokalypsi/Client/Client.scala
@@ -76,6 +76,7 @@ class Client(socket: Socket):
"don't initialize with unexecuted turn"
)
private val turnInfo = RoomState()
+ private var gameOver = false
/** Takes a client step and optionally returns an in-game event for UI
*
@@ -108,7 +109,8 @@ class Client(socket: Socket):
roomState,
this.lineToSing,
this.canAct,
- Some(timeToTurnEnd).filter(p => this.lastTurnStart != 0)
+ Some(timeToTurnEnd).filter(p => this.lastTurnStart != 0),
+ !this.gameOver
)
end clientStep
@@ -157,6 +159,9 @@ class Client(socket: Socket):
if line == TURN_INDICATOR then
this.serverLineState = ServerLineState.TurnIndicator
+ if line == GAME_END_INDICATOR then
+ this.gameOver = true
+
serverLineState match
case ServerLineState.WaitingForTimeLimit =>
@@ -185,7 +190,7 @@ class Client(socket: Socket):
case ServerLineState.Directions =>
this.turnInfo.possibleDirections = line.split(LIST_SEPARATOR)
- this.serverLineState = ServerLineState.Items // TODO: maybe use a list instead?
+ this.serverLineState = ServerLineState.Items
case ServerLineState.Items =>
this.turnInfo.visibleItems = line.split(LIST_SEPARATOR)