diff options
author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2024-11-17 17:06:56 +0200 |
---|---|---|
committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2024-11-17 17:06:56 +0200 |
commit | c954ca4d1ec677a34a6d787a23f9d01396f7e585 (patch) | |
tree | c6b00b5046bde3a98c18f9557198f852b4ce9d46 /src/scalevalapokalypsi/Server/Clients.scala | |
parent | a6b0330c845d4edad87c7059bac56e194a276c6f (diff) | |
download | scalevalapokalypsi-c954ca4d1ec677a34a6d787a23f9d01396f7e585.tar.gz scalevalapokalypsi-c954ca4d1ec677a34a6d787a23f9d01396f7e585.zip |
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
Diffstat (limited to 'src/scalevalapokalypsi/Server/Clients.scala')
-rw-r--r-- | src/scalevalapokalypsi/Server/Clients.scala | 3 |
1 files changed, 3 insertions, 0 deletions
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) |