aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/Client
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.kronqvist@iki.fi>2024-11-09 22:32:01 +0200
committerJoel Kronqvist <joel.kronqvist@iki.fi>2024-11-09 22:32:01 +0200
commitc87263e9e493fe6c130f5ad6a523871c08987f4c (patch)
treed7ee9df308a80c7a1b58ae413a7e5217fba89e6c /src/main/scala/Client
parent129b49a3876ceb68f271c311d5e45efb2e205300 (diff)
downloadscalevalapokalypsi-c87263e9e493fe6c130f5ad6a523871c08987f4c.tar.gz
scalevalapokalypsi-c87263e9e493fe6c130f5ad6a523871c08987f4c.zip
Minor change in concurrency model
Diffstat (limited to 'src/main/scala/Client')
-rw-r--r--src/main/scala/Client/Client.scala9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/main/scala/Client/Client.scala b/src/main/scala/Client/Client.scala
index ef98ef3..2503cdf 100644
--- a/src/main/scala/Client/Client.scala
+++ b/src/main/scala/Client/Client.scala
@@ -147,24 +147,19 @@ class Client(socket: Socket):
val directionDesc = "There are exits to " +
this.possibleDirections.mkString(", ")
(s"\n$actionDesc\n\n$areaDescription\n$directionDesc\n" +
- s"\n$itemDesc\n$entityDesc")
+ s"\n$itemDesc\n$entityDesc\n")
def startClient(): Unit =
stdinReader.startReading()
- // TODO: read data from server and store it in the turn description
- // TODO: if turn isn't executed since lastturnstart, display the data
- // and clean STDIN
- // TODO: write data from stdin and send it to the server
- // TODO: display timer to next turn end
while true do
sleep(POLL_INTERVAL)
this.readAndParseDataFromServer()
if this.lastExecutedTurn < this.lastTurnStart then
- println(this.giveTurn())
+ print(this.giveTurn())
stdinReader.newLine().foreach((s: String) =>
output.write(stringToByteArray(s+"\r\n"))