aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/main.scala
diff options
context:
space:
mode:
authorJoel Kronqvist <joel.kronqvist@iki.fi>2024-11-17 13:45:44 +0200
committerJoel Kronqvist <joel.kronqvist@iki.fi>2024-11-17 13:45:44 +0200
commit4de67b497e0e229fe4a42f66f833640b6e50fd5a (patch)
tree34fb5b0e776f7cd3adcb4556f4d6a7c8ad66de39 /src/main/scala/main.scala
parent8595e892abc0e0554f589ed2eb88c351a347fbd4 (diff)
downloadscalevalapokalypsi-4de67b497e0e229fe4a42f66f833640b6e50fd5a.tar.gz
scalevalapokalypsi-4de67b497e0e229fe4a42f66f833640b6e50fd5a.zip
Moved the project to an IDEA project & wrote part of README.txt
Diffstat (limited to 'src/main/scala/main.scala')
-rw-r--r--src/main/scala/main.scala26
1 files changed, 0 insertions, 26 deletions
diff --git a/src/main/scala/main.scala b/src/main/scala/main.scala
deleted file mode 100644
index d68664a..0000000
--- a/src/main/scala/main.scala
+++ /dev/null
@@ -1,26 +0,0 @@
-
-import o1game.Client.newClient
-import o1game.Server.Server
-import java.lang.Thread
-import scala.concurrent.Future
-import scala.concurrent.ExecutionContext.Implicits.global
-
-import scala.io.StdIn.readLine
-
-// TODO: add proper logic for starting the game
-@main def main(): Unit =
- print("How do you want to play?\n1) Host and join local game\n2) Join local game\n> ")
- readLine().toIntOption match
- case Some(1) =>
- Thread(() => Server(2267, 5, 30, true).startServer()).start()
- println("Server started in background.")
- print("Choose a name:\n> ")
- val name = readLine()
- newClient(name, "127.0.0.1", 2267).map(_.startClient())
- case Some(2) =>
- print("Choose a name:\n> ")
- val name = readLine()
- newClient(name, "127.0.0.1", 2267).map(_.startClient())
- case _ => println("Invalid input")
-
-