aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/scalevalapokalypsi/Client/Client.scala (renamed from src/main/scala/Client/Client.scala)8
-rw-r--r--src/scalevalapokalypsi/Client/ReceivedLineParser.scala (renamed from src/main/scala/Client/ReceivedLineParser.scala)4
-rw-r--r--src/scalevalapokalypsi/Client/StdinLineReader.scala (renamed from src/main/scala/Client/StdinLineReader.scala)2
-rw-r--r--src/scalevalapokalypsi/Client/Turn.scala (renamed from src/main/scala/Client/Turn.scala)2
-rw-r--r--src/scalevalapokalypsi/Model/Action.scala (renamed from src/main/scala/Model/Action.scala)2
-rw-r--r--src/scalevalapokalypsi/Model/Adventure.scala (renamed from src/main/scala/Model/Adventure.scala)2
-rw-r--r--src/scalevalapokalypsi/Model/Area.scala (renamed from src/main/scala/Model/Area.scala)2
-rw-r--r--src/scalevalapokalypsi/Model/Entity.scala (renamed from src/main/scala/Model/Entity.scala)2
-rw-r--r--src/scalevalapokalypsi/Model/Item.scala (renamed from src/main/scala/Model/Item.scala)2
-rw-r--r--src/scalevalapokalypsi/Server/Client.scala (renamed from src/main/scala/Server/Client.scala)6
-rw-r--r--src/scalevalapokalypsi/Server/Clients.scala (renamed from src/main/scala/Server/Clients.scala)2
-rw-r--r--src/scalevalapokalypsi/Server/ConnectionGetter.scala (renamed from src/main/scala/Server/ConnectionGetter.scala)2
-rw-r--r--src/scalevalapokalypsi/Server/Server.scala (renamed from src/main/scala/Server/Server.scala)8
-rw-r--r--src/scalevalapokalypsi/constants/constants.scala (renamed from src/main/scala/Server/constants.scala)2
-rw-r--r--src/scalevalapokalypsi/main.scala (renamed from src/main/scala/main.scala)7
-rw-r--r--src/scalevalapokalypsi/utils/utils.scala (renamed from src/main/scala/utils.scala)2
16 files changed, 28 insertions, 27 deletions
diff --git a/src/main/scala/Client/Client.scala b/src/scalevalapokalypsi/Client/Client.scala
index fc3e6b8..41b1003 100644
--- a/src/main/scala/Client/Client.scala
+++ b/src/scalevalapokalypsi/Client/Client.scala
@@ -1,12 +1,12 @@
-package o1game.Client
+package scalevalapokalypsi.Client
import java.lang.Thread.sleep
import java.net.Socket
import scala.io.Source
import scala.sys.process.stdout
-import o1game.constants.*
-import o1game.utils.{stringToByteArray,getNCharsFromSocket}
-import o1game.Client.{ReceivedLineParser,StdinLineReader,Turn}
+import scalevalapokalypsi.constants.*
+import scalevalapokalypsi.utils.{stringToByteArray,getNCharsFromSocket}
+import scalevalapokalypsi.Client.{ReceivedLineParser,StdinLineReader,Turn}
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
import scala.util.{Try, Success, Failure}
diff --git a/src/main/scala/Client/ReceivedLineParser.scala b/src/scalevalapokalypsi/Client/ReceivedLineParser.scala
index 7cbf935..dfcc2d2 100644
--- a/src/main/scala/Client/ReceivedLineParser.scala
+++ b/src/scalevalapokalypsi/Client/ReceivedLineParser.scala
@@ -1,7 +1,7 @@
-package o1game.Client
+package scalevalapokalypsi.Client
import scala.collection.mutable.Buffer
-import o1game.constants.*
+import scalevalapokalypsi.constants.*
/** A class for checking asynchronously for received lines */
class ReceivedLineParser:
diff --git a/src/main/scala/Client/StdinLineReader.scala b/src/scalevalapokalypsi/Client/StdinLineReader.scala
index 42a1f40..6ba8761 100644
--- a/src/main/scala/Client/StdinLineReader.scala
+++ b/src/scalevalapokalypsi/Client/StdinLineReader.scala
@@ -1,4 +1,4 @@
-package o1game.Client
+package scalevalapokalypsi.Client
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
diff --git a/src/main/scala/Client/Turn.scala b/src/scalevalapokalypsi/Client/Turn.scala
index 6b78811..30101c5 100644
--- a/src/main/scala/Client/Turn.scala
+++ b/src/scalevalapokalypsi/Client/Turn.scala
@@ -1,4 +1,4 @@
-package o1game.Client
+package scalevalapokalypsi.Client
/** `Turn`s represent information the client has got about a turn.
* This class exists essentially so that the client has somewhere
diff --git a/src/main/scala/Model/Action.scala b/src/scalevalapokalypsi/Model/Action.scala
index 55f7f27..32f513d 100644
--- a/src/main/scala/Model/Action.scala
+++ b/src/scalevalapokalypsi/Model/Action.scala
@@ -1,4 +1,4 @@
-package o1game.Model
+package scalevalapokalypsi.Model
/** The class `Action` represents actions that a player may take in a text adventure game.
* `Action` objects are constructed on the basis of textual commands and are, in effect,
diff --git a/src/main/scala/Model/Adventure.scala b/src/scalevalapokalypsi/Model/Adventure.scala
index dfcb100..2bf6cfe 100644
--- a/src/main/scala/Model/Adventure.scala
+++ b/src/scalevalapokalypsi/Model/Adventure.scala
@@ -1,4 +1,4 @@
-package o1game.Model
+package scalevalapokalypsi.Model
import scala.collection.mutable.Map
diff --git a/src/main/scala/Model/Area.scala b/src/scalevalapokalypsi/Model/Area.scala
index 6721957..c891af8 100644
--- a/src/main/scala/Model/Area.scala
+++ b/src/scalevalapokalypsi/Model/Area.scala
@@ -1,4 +1,4 @@
-package o1game.Model
+package scalevalapokalypsi.Model
import scala.collection.mutable.Map
diff --git a/src/main/scala/Model/Entity.scala b/src/scalevalapokalypsi/Model/Entity.scala
index d8e8559..083c37f 100644
--- a/src/main/scala/Model/Entity.scala
+++ b/src/scalevalapokalypsi/Model/Entity.scala
@@ -1,4 +1,4 @@
-package o1game.Model
+package scalevalapokalypsi.Model
import scala.collection.mutable.{Buffer,Map}
diff --git a/src/main/scala/Model/Item.scala b/src/scalevalapokalypsi/Model/Item.scala
index 229828d..7979480 100644
--- a/src/main/scala/Model/Item.scala
+++ b/src/scalevalapokalypsi/Model/Item.scala
@@ -1,4 +1,4 @@
-package o1game.Model
+package scalevalapokalypsi.Model
import scala.annotation.targetName
diff --git a/src/main/scala/Server/Client.scala b/src/scalevalapokalypsi/Server/Client.scala
index 3cd2b36..6ce2522 100644
--- a/src/main/scala/Server/Client.scala
+++ b/src/scalevalapokalypsi/Server/Client.scala
@@ -1,10 +1,10 @@
-package o1game.Server
+package scalevalapokalypsi.Server
import java.net.Socket
import scala.math.min
-import o1game.constants.*
+import scalevalapokalypsi.constants.*
import ServerProtocolState.*
-import o1game.Model.{Action,Player,Entity}
+import scalevalapokalypsi.Model.{Action,Player,Entity}
class Client(val socket: Socket):
private var incompleteMessage: Array[Byte] =
diff --git a/src/main/scala/Server/Clients.scala b/src/scalevalapokalypsi/Server/Clients.scala
index 6487446..377050d 100644
--- a/src/main/scala/Server/Clients.scala
+++ b/src/scalevalapokalypsi/Server/Clients.scala
@@ -1,4 +1,4 @@
-package o1game.Server
+package scalevalapokalypsi.Server
import scala.util.Try
import scala.util.Random
diff --git a/src/main/scala/Server/ConnectionGetter.scala b/src/scalevalapokalypsi/Server/ConnectionGetter.scala
index b3246a7..40830c7 100644
--- a/src/main/scala/Server/ConnectionGetter.scala
+++ b/src/scalevalapokalypsi/Server/ConnectionGetter.scala
@@ -1,4 +1,4 @@
-package o1game.Server
+package scalevalapokalypsi.Server
import java.io.IOException
import java.net.{ServerSocket, Socket}
diff --git a/src/main/scala/Server/Server.scala b/src/scalevalapokalypsi/Server/Server.scala
index 7864c49..13ca2f5 100644
--- a/src/main/scala/Server/Server.scala
+++ b/src/scalevalapokalypsi/Server/Server.scala
@@ -1,4 +1,4 @@
-package o1game.Server
+package scalevalapokalypsi.Server
// TODO: TLS/SSL / import javax.net.ssl.SSLServerSocketFactory
@@ -6,9 +6,9 @@ package o1game.Server
import java.lang.Thread.{currentThread, sleep}
import java.io.IOException
import java.net.{ServerSocket, Socket}
-import o1game.constants.*
-import o1game.Model.{Adventure,Entity,Player}
-import o1game.utils.stringToByteArray
+import scalevalapokalypsi.constants.*
+import scalevalapokalypsi.Model.{Adventure,Entity,Player}
+import scalevalapokalypsi.utils.stringToByteArray
import java.lang.System.currentTimeMillis
import scala.util.Try
diff --git a/src/main/scala/Server/constants.scala b/src/scalevalapokalypsi/constants/constants.scala
index 083db4e..d5abb43 100644
--- a/src/main/scala/Server/constants.scala
+++ b/src/scalevalapokalypsi/constants/constants.scala
@@ -1,5 +1,5 @@
-package o1game.constants
+package scalevalapokalypsi.constants
val MAX_MSG_SIZE = 1024 // bytes
val CRLF: Vector[Byte] = Vector(13.toByte, 10.toByte)
diff --git a/src/main/scala/main.scala b/src/scalevalapokalypsi/main.scala
index d68664a..9633f73 100644
--- a/src/main/scala/main.scala
+++ b/src/scalevalapokalypsi/main.scala
@@ -1,6 +1,7 @@
+package scalevalapokalypsi
-import o1game.Client.newClient
-import o1game.Server.Server
+import scalevalapokalypsi.Client.newClient
+import scalevalapokalypsi.Server.Server
import java.lang.Thread
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
@@ -12,7 +13,7 @@ import scala.io.StdIn.readLine
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()
+ Thread(() => new Server(2267, 5, 30, true).startServer()).start()
println("Server started in background.")
print("Choose a name:\n> ")
val name = readLine()
diff --git a/src/main/scala/utils.scala b/src/scalevalapokalypsi/utils/utils.scala
index cfca568..b1bac4d 100644
--- a/src/main/scala/utils.scala
+++ b/src/scalevalapokalypsi/utils/utils.scala
@@ -1,4 +1,4 @@
-package o1game.utils
+package scalevalapokalypsi.utils
import java.io.InputStream