new PopulationCapManager()
- Source:
Members
CAPTYPE_PLAYER_POPULATION
- Source:
CAPTYPE_TEAM_POPULATION
- Source:
CAPTYPE_WORLD_POPULATION
- Source:
Schema
- Source:
perPlayerPopCaps
- Source:
popCap
- Source:
popCapType
- Source:
popCapType
- Source:
Methods
GetPopulationCap() → {number}
Get the current pop cap.
- Source:
Returns:
- Type
- number
GetPopulationCapType() → {string}
Get the current pop cap type.
- Source:
Returns:
- Type
- string
Init()
- Source:
InitializePlayerPopCaps()
Assign all players the same, fixed pop cap.
- Source:
InitializePopCaps()
Calculate and distribute the pop caps for the first time. Called as soon as cap and cap type are set.
- Source:
InitializeTeamPopCaps()
Loop through all teams and distribute the fixed pop cap among their living members.
- Source:
OnGlobalPlayerDefeated()
Redistribute the pop caps depending on the pop cap type.
Parameters:
| Name | Type | Description |
|---|---|---|
msg.playerId |
number | the defeated player's ID. |
- Source:
OnTeamChanged()
Redistribute pop caps when a player is moved from one team to another.
Parameters:
| Name | Type | Description |
|---|---|---|
msg.player |
number | the ID of the player. |
msg.oldTeam |
number | the ID of the team the player was previously part of. |
msg.newTeam |
number | the ID of the team the player is moved to. |
- Source:
RedistributeTeamPopCap(team)
Recalculate and update a single team's members' pop caps.
Parameters:
| Name | Type | Description |
|---|---|---|
team |
number | ID specifying the team. |
- Source:
RedistributeWorldPopCap()
Recalculate the players' new pop cap and assign it to all of them.
- Source:
SetPerPlayerPopulationCaps()
- Source:
SetPopulationCap(cap)
Set the pop cap and, if possible, initialize the first distribution.
Parameters:
| Name | Type | Description |
|---|---|---|
cap |
number |
- Source:
SetPopulationCapType(type)
Set the pop cap type and, if possible, initialize the first distribution.
Parameters:
| Name | Type | Description |
|---|---|---|
type |
string |
- Source: