diff options
| author | Pinapelz <yukais@pinapelz.com> | 2026-10-19 15:32:53 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-10-19 15:32:53 -0700 |
| commit | 304bd1e77a5442f614aacd2b35f330777118b2cd (patch) | |
| tree | 970e7da13bb1bd8edf1f9b453af4d0994c665e94 /src/ClientTools.hx | |
| parent | a4f3064542ddad6939598e7e60ca0090be07df60 (diff) | |
Diffstat (limited to 'src/ClientTools.hx')
| -rw-r--r-- | src/ClientTools.hx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ClientTools.hx b/src/ClientTools.hx index 46400f7..5da23c4 100644 --- a/src/ClientTools.hx +++ b/src/ClientTools.hx @@ -1,8 +1,5 @@ package; -import Types.Permission; -import Types.Permissions; - class ClientTools { public static function setLeader(clients:Array<Client>, name:String):Void { for (client in clients) { @@ -12,10 +9,14 @@ class ClientTools { } public static function hasLeader(clients:Array<Client>):Bool { + return getLeader(clients) != null; + } + + public static function getLeader(clients:Array<Client>):Null<Client> { for (client in clients) { - if (client.isLeader) return true; + if (client.isLeader) return client; } - return false; + return null; } public static function getByName( |
