Skip to content

1681-engine / index / balanceTeams

Function: balanceTeams() ​

ts
function balanceTeams(
   groups, 
   teams, 
   size
): number[][] | null;

Defined in: src/net/lobby/Matchmaker.ts:147

Splits groups into teams of exactly size players, parties whole, ratings as even as it can: the largest groups first, each into the team with room whose rating total is lowest. Returns null when the sizes cannot be packed.

Parameters ​

ParameterType
groupsreadonly Ticket[]
teamsnumber
sizenumber

Returns ​

number[][] | null

Released under the MIT License.