Arma Reforger Script API
|
Public Member Functions | |
SCR_BasePlayerLoadout | GetPlayerLoadout (int playerId) |
Return assigned loadout of provided player by their id. | |
SCR_BasePlayerLoadout | GetLocalPlayerLoadout () |
Return loadout of of local player. | |
int | GetLoadoutPlayerCount (SCR_BasePlayerLoadout loadout) |
Returns current count of players assigned to the provided loadout. | |
void | UpdatePlayerLoadout_S (SCR_PlayerLoadoutComponent playerLoadoutComponent) |
Authority: Update player loadout info for target player with their up-to-date state. | |
bool | CanAssignLoadout_S (SCR_PlayerLoadoutComponent playerLoadoutComponent, SCR_BasePlayerLoadout loadout) |
Authority: Return whether provided loadout can be set for the requesting player. | |
array< ref SCR_BasePlayerLoadout > | GetPlayerLoadouts () |
int | GetLoadoutCount () |
Returns the number of loadouts provided by this manager or 0 if none. | |
int | GetLoadoutIndex (SCR_BasePlayerLoadout loadout) |
Returns index of provided loadout or -1 if none. | |
SCR_BasePlayerLoadout | GetLoadoutByIndex (int index) |
Returns loadout at provided index or null if none. | |
SCR_BasePlayerLoadout | GetLoadoutByName (string name) |
Returns the first loadout with the provided name, or null if none were found. | |
SCR_BasePlayerLoadout | GetRandomFactionLoadout (Faction faction) |
Returns random loadout that belongs to provided faction or null if none. | |
int | GetPlayerLoadoutsByFaction (Faction faction, out notnull array< ref SCR_BasePlayerLoadout > outLoadouts) |
int | GetPlayerLoadouts (out notnull array< SCR_BasePlayerLoadout > outLoadouts) |
int | GetRandomLoadoutIndex (Faction faction) |
int | GetRandomLoadoutIndex () |
SCR_BasePlayerLoadout | GetRandomLoadout () |
ScriptInvoker | GetOnMappedPlayerLoadoutInfoChanged () |
void | SCR_LoadoutManager (IEntitySource src, IEntity parent) |
void | ~SCR_LoadoutManager () |
destructor | |
Static Public Member Functions | |
static SCR_BasePlayerLoadout | SGetPlayerLoadout (int playerId) |
Return loadout of provided player by their id. | |
static SCR_BasePlayerLoadout | SGetLocalPlayerLoadout () |
Return loadout of local player. | |
static int | SGetLoadoutPlayerCount (SCR_BasePlayerLoadout loadout) |
Return count of players assigned to the provided loadout. | |
Protected Member Functions | |
void | OnPlayerLoadoutInfoChanged () |
Update local player loadout mapping. | |
void | OnPlayerLoadoutCountChanged (SCR_BasePlayerLoadout loadout, int newCount) |
Anyone: Event raised when provided faction's player count changes. | |
void | OnPlayerLoadoutSet_S (SCR_PlayerLoadoutComponent playerComponent, SCR_BasePlayerLoadout loadout) |
Authority: Event raised when provided player component has a loadout set. | |
Protected Attributes | |
ref array< ref SCR_BasePlayerLoadout > | m_aPlayerLoadouts |
ref array< ref SCR_PlayerLoadoutInfo > | m_aPlayerLoadoutInfo = {} |
List of all player loadout infos in no particular order. Maintained by the authority. | |
ref map< int, int > | m_PreviousPlayerLoadouts = new map<int, int>() |
Map of previous player <playerId : loadoutIndex>. | |
ref set< int > | m_ChangedLoadouts = new set<int>() |
List of indices of loadouts whose count has changed since last update. | |
ref map< int, ref SCR_PlayerLoadoutInfo > | m_MappedPlayerLoadoutInfo = new map<int, ref SCR_PlayerLoadoutInfo>() |
Local mapping of playerId to player loadout info. | |
ref map< int, int > | m_PlayerCount = new map<int, int>() |
Mapping of loadout id:player count. | |
ref ScriptInvoker< SCR_BasePlayerLoadout, int > | m_OnMappedPlayerLoadoutInfoChanged |
Static Protected Attributes | |
static const int | INVALID_LOADOUT_INDEX = -1 |
void SCR_LoadoutManager.SCR_LoadoutManager | ( | IEntitySource | src, |
IEntity | parent | ||
) |
[in] | src | |
[in] | parent |
void SCR_LoadoutManager.~SCR_LoadoutManager | ( | ) |
destructor
bool SCR_LoadoutManager.CanAssignLoadout_S | ( | SCR_PlayerLoadoutComponent | playerLoadoutComponent, |
SCR_BasePlayerLoadout | loadout | ||
) |
Authority: Return whether provided loadout can be set for the requesting player.
Game logic can be implemented here, e.g. maximum slots.
[in] | playerLoadoutComponent | |
[in] | loadout |
SCR_BasePlayerLoadout SCR_LoadoutManager.GetLoadoutByIndex | ( | int | index | ) |
Returns loadout at provided index or null if none.
[in] | index |
SCR_BasePlayerLoadout SCR_LoadoutManager.GetLoadoutByName | ( | string | name | ) |
Returns the first loadout with the provided name, or null if none were found.
[in] | name |
int SCR_LoadoutManager.GetLoadoutCount | ( | ) |
Returns the number of loadouts provided by this manager or 0 if none.
int SCR_LoadoutManager.GetLoadoutIndex | ( | SCR_BasePlayerLoadout | loadout | ) |
Returns index of provided loadout or -1 if none.
[in] | loadout |
int SCR_LoadoutManager.GetLoadoutPlayerCount | ( | SCR_BasePlayerLoadout | loadout | ) |
Returns current count of players assigned to the provided loadout.
[in] | loadout |
SCR_BasePlayerLoadout SCR_LoadoutManager.GetLocalPlayerLoadout | ( | ) |
Return loadout of of local player.
Exception | if no SCR_LoadoutManager is present in the world. |
ScriptInvoker SCR_LoadoutManager.GetOnMappedPlayerLoadoutInfoChanged | ( | ) |
SCR_BasePlayerLoadout SCR_LoadoutManager.GetPlayerLoadout | ( | int | playerId | ) |
Return assigned loadout of provided player by their id.
[in] | playerId | Id of target player corresponding to PlayerController/PlayerManager player id. |
array< ref SCR_BasePlayerLoadout > SCR_LoadoutManager.GetPlayerLoadouts | ( | ) |
int SCR_LoadoutManager.GetPlayerLoadouts | ( | out notnull array< SCR_BasePlayerLoadout > | outLoadouts | ) |
[out] | outLoadouts |
int SCR_LoadoutManager.GetPlayerLoadoutsByFaction | ( | Faction | faction, |
out notnull array< ref SCR_BasePlayerLoadout > | outLoadouts | ||
) |
[in] | faction | |
[out] | outLoadouts |
SCR_BasePlayerLoadout SCR_LoadoutManager.GetRandomFactionLoadout | ( | Faction | faction | ) |
Returns random loadout that belongs to provided faction or null if none.
[in] | faction |
SCR_BasePlayerLoadout SCR_LoadoutManager.GetRandomLoadout | ( | ) |
int SCR_LoadoutManager.GetRandomLoadoutIndex | ( | ) |
int SCR_LoadoutManager.GetRandomLoadoutIndex | ( | Faction | faction | ) |
[in] | faction |
|
protected |
Anyone: Event raised when provided faction's player count changes.
Note: Order of changes is not fully deterministic, e.g. when changing faction from A to B, this method might be invoked in the order B, A instead.
[in] | loadout | The loadout for which affiliated player count changed. |
[in] | newCount | The new number of players that are using this loadout. |
|
protected |
Update local player loadout mapping.
|
protected |
Authority: Event raised when provided player component has a loadout set.
|
static |
Return count of players assigned to the provided loadout.
Static variant of SCR_LoadoutManager.GetLoadoutPlayerCount that uses registered FactionManager from the ArmaReforgerScripted game instance.
Exception | if no FactionManager is present in the world. |
[in] | loadout |
|
static |
Return loadout of local player.
Static variant of SCR_LoadoutManager.GetLocalPlayerLoadout that uses registered SCR_LoadoutManager from the ArmaReforgerScripted game instance.
Exception | if no SCR_LoadoutManager is present in the world. |
|
static |
Return loadout of provided player by their id.
Static variant of SCR_LoadoutManager.GetPlayerLoadout that uses registered SCR_LoadoutManager from the ArmaReforgerScripted game instance.
[in] | playerId | Id of target player corresponding to PlayerController/PlayerManager player id. |
Exception | if no SCR_LoadoutManager is present in the world. |
void SCR_LoadoutManager.UpdatePlayerLoadout_S | ( | SCR_PlayerLoadoutComponent | playerLoadoutComponent | ) |
Authority: Update player loadout info for target player with their up-to-date state.
[in] | playerLoadoutComponent |
|
staticprotected |
|
protected |
List of all player loadout infos in no particular order. Maintained by the authority.
|
protected |
|
protected |
List of indices of loadouts whose count has changed since last update.
|
protected |
Local mapping of playerId to player loadout info.
|
protected |
|
protected |
Mapping of loadout id:player count.
|
protected |
Map of previous player <playerId : loadoutIndex>.