package Force import NoWurst public function force.destr() DestroyForce(this) public function force.addPlayer(player whichPlayer) ForceAddPlayer(this, whichPlayer) public function force.addPlayers(vararg player players) for whichPlayer in players ForceAddPlayer(this, whichPlayer) public function force.removePlayer(player whichPlayer) ForceRemovePlayer(this, whichPlayer) public function force.removePlayers(vararg player players) for whichPlayer in players ForceRemovePlayer(this, whichPlayer) public function force.clear() ForceClear(this) public function force.enumPlayers(boolexpr filter) ForceEnumPlayers(this, filter) public function force.enumPlayersCounted(boolexpr filter, int countLimit) ForceEnumPlayersCounted(this, filter, countLimit) public function force.enumAllies(player whichPlayer, boolexpr filter) ForceEnumAllies(this, whichPlayer, filter) public function force.enumEnemies(player whichPlayer, boolexpr filter) ForceEnumEnemies(this, whichPlayer, filter) public function force.forEach(code callback) ForForce(this, callback) public function force.getRandomPlayer() returns player return ForcePickRandomPlayer(this) public function force.containsUnit(unit whichUnit) returns boolean return IsUnitInForce(whichUnit, this) public function force.containsPlayer(player whichPlayer) returns boolean return IsPlayerInForce(whichPlayer, this) /* Force iterator */ force iterForce /** Creates a new iterator for this group. */ public function force.iterator() returns force iterForce = CreateForce() ForForce(this, () -> iterForce.addPlayer(GetEnumPlayer())) return iterForce /** Returns whether the iterator has the next item */ public function force.hasNext() returns boolean return this.getRandomPlayer() != null /** Returns the next item from the iterator */ public function force.next() returns player let iterPlayer = this.getRandomPlayer() this.removePlayer(iterPlayer) return iterPlayer /** Closes the iterator, releaseing the group */ public function force.close() this.clear() this.destr()