voidAddTeam(C4Team*pNewTeam);// add a team; grow list if necessary
int32_tGetFreeTeamID();
boolGenerateDefaultTeams(int32_tiUpToID);// generate Team 1, Team 2, etc.
public:
C4Team*GetTeamByID(int32_tiID)const;// get team by ID
C4Team*GetGenerateTeamByID(int32_tiID);// get team by ID; generate if not existant. Always generate for TEAMID_New.
C4Team*GetTeamByIndex(int32_tiIndex)const;// get team by list index, to enumerate all teams
C4Team*GetTeamByName(constchar*szName)const;// match team name; case sensitive and not trimmed
C4Team*GetTeamByPlayerID(int32_tiID)const;// get team by player ID (not number!)
int32_tGetLargestTeamID()const;
C4Team*GetRandomSmallestTeam()const;// get team with least amount of players in it
int32_tGetTeamCount()const{returniTeamCount;}
C4Team*CreateTeam(constchar*szName);// create a custom team
boolIsMultiTeams()const{returnfActive;}// teams can be selected
boolIsCustom()const{returnfCustom;}// whether teams are not generated as default
boolIsHostilityChangeAllowed()const{returnfAllowHostilityChange;}// allow (temporary) hostility changes at runtime
boolIsTeamSwitchAllowed()const{returnfAllowTeamSwitch;}// allow permanent team changes at runtime
boolCanLocalChooseTeam()const;// whether the local host can determine teams (e.g., not if teams are random, or if all except the player's current team are full)
boolCanLocalChooseTeam(int32_tidPlayer)const;// whether the local host can determine teams (e.g., not if teams are random, or if all except the player's current team are full)
boolCanLocalSeeTeam()const;
boolIsTeamColors()const{returnfTeamColors;}// whether team colors are enabled
boolIsRandomTeam()const{returneTeamDist==TEAMDIST_Random||eTeamDist==TEAMDIST_RandomInv;}// whether team colors are enabled
boolIsJoin2TeamAllowed(int32_tidTeam);// checks whether a team ID is valid and still available for new joins
boolLoad(C4Group&hGroup,classC4Scenario*pInitDefault,classC4LangStringTable*pLang);// clear self and load from group file (C4CFN_Teams); init default by scen if no team fiel is present
boolSave(C4Group&hGroup);// save to group file (C4CFN_Teams)
// this rechecks teams for all (not removed) players; sets players here by team selection in player infos
voidRecheckPlayers();
// this reorders any unjoined players to teams if they are unevenly filled and team distribution is random
// any changed players will be flagged "updated"
voidRecheckTeams();
// marks all unjoined players as not-in-team and reassigns a team for them
// also automatically flags all affected player infos as updated