src/main/java/eu/chehowski/Matchmaker.java
@ThreadSafe
    public Optional<GroupInfo> performMatchmaking(final int numPlayers)
    {
        final Collection<PlayerInfo> players = quadTree.take(numPlayers);
        if (!players.isEmpty())
        {
            final GroupInfo groupInfo = new GroupInfo(currentGroupIndex.getAndIncrement(), players);
            return Optional.of(groupInfo);
        }

        return Optional.empty();
    }
/**
     * Takes n players for the matchmaking from the most loaded part of space.
     *
     * @param numPlayers Number of players to be removed from the quad tree.
     * @return A newly-constructed group of players.
     */
Takes n players for the matchmaking from the most loaded part of space.
@param numPlayers Number of players to be removed from the quad tree.
@return A newly-constructed group of players.
Takes n players for the matchmaking from the most loaded part of space . @param numPlayers Number of players to be removed from the quad tree . @return A newly - constructed group of players .
@ThreadSafe
    public Optional<GroupInfo> performMatchmaking(final int numPlayers)
    {
        final Collection<PlayerInfo> players = quadTree.take(numPlayers);
        if (!players.isEmpty())
        {
            final GroupInfo groupInfo = new GroupInfo(currentGroupIndex.getAndIncrement(), players);
            return Optional.of(groupInfo);
        }
        return Optional.empty();
    }
@ ThreadSafe public Optional < GroupInfo > performMatchmaking ( final int numPlayers ) { final Collection < PlayerInfo > players = quadTree . take ( numPlayers ) ; if ( ! players . isEmpty ( ) ) { final GroupInfo groupInfo = new GroupInfo ( currentGroupIndex . getAndIncrement ( ) , players ) ; return Optional . of ( groupInfo ) ; } return Optional . empty ( ) ; }
Takes n players for the matchmaking from the most loaded part of space.
Takes n players for the matchmaking from the most loaded part of space .