aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/main.scala
blob: 18172e2ccd0beb21db5d16a462c1b1287c04bbd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

import o1game.Client.Client
import o1game.Server.Server

import scala.io.StdIn.readLine

// TODO: add proper logic for starting the game
@main def main(): Unit =
    print("Please choose:\n1) Client.Client\n2) Server\n> ")
    readLine().toIntOption match
        case Some(1) => Client("127.0.0.1", 2267).startClient()
        case Some(2) => Server(2267, 5).startServer()
        case _ => println("Invalid input")