rooms service methods implementation

removed stubbed room, but thing compiles and maybe will work?
lot's of pain with trying to store Topic inside Ref together with Room.

storing them together in a tuple means for the room there should always
be a topic
but then modifying the room in side of ref is uncomfortable, because i
want to do F[Unit] send updated room together with room modification,
but Ref seems to take in only pure function to update the value

there got to be maybe some semaphors or something like that?
and storing topics where? in a separate state?
that would maybe simplify things, but i'm coding well into the night and
that's not a good idea really

now before testing this with front end, i need a way to create a room.
This commit is contained in:
efim
2023-04-28 02:38:03 +04:00
parent bd38a29b6d
commit 8098f24552
3 changed files with 115 additions and 33 deletions

View File

@@ -63,7 +63,7 @@ object Models {
password: String,
allowedCards: List[String],
round: RoundState,
playersPasswords: Map[String, String] = Map.empty // nickname into password
playersPasswords: Map[String, String] = Map.empty, // nickname into password
) {
def getViewFor(playerId: PlayerID): RoomStateView = {
players