aboutsummaryrefslogtreecommitdiff
path: root/src/scalevalapokalypsi/Server/Clients.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/scalevalapokalypsi/Server/Clients.scala')
-rw-r--r--src/scalevalapokalypsi/Server/Clients.scala3
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)