From c954ca4d1ec677a34a6d787a23f9d01396f7e585 Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Sun, 17 Nov 2024 17:06:56 +0200 Subject: Template for singing, WIP. * The line to sing is always the same. * The client recovers weirdly from singing before the next turn and my brain is currently too fried to figure out why --- src/scalevalapokalypsi/Server/Clients.scala | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/scalevalapokalypsi/Server/Clients.scala') diff --git a/src/scalevalapokalypsi/Server/Clients.scala b/src/scalevalapokalypsi/Server/Clients.scala index 377050d..9ad0e84 100644 --- a/src/scalevalapokalypsi/Server/Clients.scala +++ b/src/scalevalapokalypsi/Server/Clients.scala @@ -25,6 +25,9 @@ class Clients(maxClients: Int): * @return an iterable of all the clients */ def allClients: Iterable[Client] = clients.toVector.flatten + + def filter(p: Client => Boolean): Iterable[Client] = + this.allClients.filter(p) /** Applies the function `f` to all the clients for its side effects. */ def foreach(f: Client => Any): Unit = this.clients.flatten.foreach(f) -- cgit v1.2.3