Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_LoadoutManager.c File Reference

Go to the source code of this file.

Classes

class  SCR_LoadoutManagerClass

Functions

SCR_BasePlayerLoadout GetPlayerLoadout (int playerId)
SCR_BasePlayerLoadout GetLocalPlayerLoadout ()
int GetLoadoutPlayerCount (SCR_BasePlayerLoadout loadout)
void OnPlayerLoadoutInfoChanged ()
 Update local player loadout mapping.
void OnPlayerLoadoutCountChanged (SCR_BasePlayerLoadout loadout, int newCount)
void OnPlayerLoadoutSet_S (SCR_PlayerLoadoutComponent playerComponent, SCR_BasePlayerLoadout loadout)
void UpdatePlayerLoadout_S (SCR_PlayerLoadoutComponent playerLoadoutComponent)
bool CanAssignLoadout_S (SCR_PlayerLoadoutComponent playerLoadoutComponent, SCR_BasePlayerLoadout loadout)
array< ref SCR_BasePlayerLoadoutGetPlayerLoadouts ()
int GetLoadoutCount ()
 Returns the number of loadouts provided by this manager or 0 if none.
int GetLoadoutIndex (SCR_BasePlayerLoadout loadout)
SCR_BasePlayerLoadout GetLoadoutByIndex (int index)
SCR_BasePlayerLoadout GetLoadoutByName (string name, FactionKey faction=string.Empty)
SCR_BasePlayerLoadout GetRandomFactionLoadout (Faction faction)
bool IsFactionSupportingCsutomLoadouts (notnull Faction faction)
int GetPlayerLoadoutsByFaction (Faction faction, out notnull array< ref SCR_BasePlayerLoadout > outLoadouts)
int GetPlayerLoadoutsByGroup (notnull SCR_AIGroup group, notnull 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

Variables

SCR_LoadoutManagerClass INVALID_LOADOUT_INDEX = -1
ref array< ref SCR_BasePlayerLoadoutm_aPlayerLoadouts
ref array< ref SCR_PlayerLoadoutInfom_aPlayerLoadoutInfo = {}
 List of all player loadout infos in no particular order. Maintained by the authority.
ref map< int, intm_PreviousPlayerLoadouts = new map<int, int>()
 Map of previous player <playerId : loadoutIndex>.
ref set< intm_ChangedLoadouts = new set<int>()
 List of indices of loadouts whose count has changed since last update.
ref map< int, ref SCR_PlayerLoadoutInfom_MappedPlayerLoadoutInfo = new map<int, ref SCR_PlayerLoadoutInfo>()
 Local mapping of playerId to player loadout info.
ref map< int, intm_PlayerCount = new map<int, int>()
 Mapping of loadout id:player count.
ref ScriptInvoker< SCR_BasePlayerLoadout, intm_OnMappedPlayerLoadoutInfoChanged

Function Documentation

◆ CanAssignLoadout_S()

bool CanAssignLoadout_S ( SCR_PlayerLoadoutComponent playerLoadoutComponent,
SCR_BasePlayerLoadout loadout )
protected

Authority: Return whether provided loadout can be set for the requesting player. Game logic can be implemented here, e.g. maximum slots.

Parameters
[in]playerLoadoutComponent
[in]loadout
Returns

Definition at line 278 of file SCR_LoadoutManager.c.

◆ GetLoadoutByIndex()

SCR_BasePlayerLoadout GetLoadoutByIndex ( int index)
protected

Returns loadout at provided index or null if none.

Parameters
[in]index
Returns

Definition at line 318 of file SCR_LoadoutManager.c.

◆ GetLoadoutByName()

SCR_BasePlayerLoadout GetLoadoutByName ( string name,
FactionKey faction = string.Empty )
protected

Returns the first loadout with the provided name, or null if none were found.

Parameters
[in]name
Returns

Definition at line 330 of file SCR_LoadoutManager.c.

◆ GetLoadoutCount()

int GetLoadoutCount ( )
protected

Returns the number of loadouts provided by this manager or 0 if none.

Definition at line 292 of file SCR_LoadoutManager.c.

◆ GetLoadoutIndex()

int GetLoadoutIndex ( SCR_BasePlayerLoadout loadout)
protected

Returns index of provided loadout or -1 if none.

Parameters
[in]loadout

Definition at line 303 of file SCR_LoadoutManager.c.

◆ GetLoadoutPlayerCount()

int GetLoadoutPlayerCount ( SCR_BasePlayerLoadout loadout)
protected

Returns current count of players assigned to the provided loadout.

Parameters
[in]loadout
Returns
Number of players or always 0 if no loadout is provided.

Definition at line 86 of file SCR_LoadoutManager.c.

◆ GetLocalPlayerLoadout()

SCR_BasePlayerLoadout GetLocalPlayerLoadout ( )
protected

Return loadout of of local player.

Exceptions
Exceptionif no SCR_LoadoutManager is present in the world.
Returns
SCR_BasePlayerLoadout instance if loadout is assigned, null otherwise.

Definition at line 64 of file SCR_LoadoutManager.c.

◆ GetOnMappedPlayerLoadoutInfoChanged()

ScriptInvoker GetOnMappedPlayerLoadoutInfoChanged ( )
protected
Returns

Definition at line 533 of file SCR_LoadoutManager.c.

◆ GetPlayerLoadout()

SCR_BasePlayerLoadout GetPlayerLoadout ( int playerId)
protected

Return assigned loadout of provided player by their id.

Parameters
[in]playerIdId of target player corresponding to PlayerController/PlayerManager player id.
Returns
loadout instance if loadout is assigned, null otherwise.

Definition at line 35 of file SCR_LoadoutManager.c.

◆ GetPlayerLoadouts() [1/2]

array< ref SCR_BasePlayerLoadout > GetPlayerLoadouts ( )
protected
Returns

Definition at line 285 of file SCR_LoadoutManager.c.

◆ GetPlayerLoadouts() [2/2]

int GetPlayerLoadouts ( out notnull array< SCR_BasePlayerLoadout > outLoadouts)
protected
Parameters
[out]outLoadouts
Returns

Definition at line 471 of file SCR_LoadoutManager.c.

◆ GetPlayerLoadoutsByFaction()

int GetPlayerLoadoutsByFaction ( Faction faction,
out notnull array< ref SCR_BasePlayerLoadout > outLoadouts )
protected
Parameters
[in]faction
[out]outLoadouts
Returns

Definition at line 381 of file SCR_LoadoutManager.c.

◆ GetPlayerLoadoutsByGroup()

int GetPlayerLoadoutsByGroup ( notnull SCR_AIGroup group,
notnull Faction faction,
out notnull array< ref SCR_BasePlayerLoadout > outLoadouts )
protected
Parameters
[in]group
[in]faction
[out]outLoadouts
Returns

Definition at line 425 of file SCR_LoadoutManager.c.

◆ GetRandomFactionLoadout()

SCR_BasePlayerLoadout GetRandomFactionLoadout ( Faction faction)
protected

Returns random loadout that belongs to provided faction or null if none.

Parameters
[in]faction

Definition at line 350 of file SCR_LoadoutManager.c.

◆ GetRandomLoadout()

SCR_BasePlayerLoadout GetRandomLoadout ( )
protected
Returns

Definition at line 522 of file SCR_LoadoutManager.c.

◆ GetRandomLoadoutIndex() [1/2]

int GetRandomLoadoutIndex ( )
protected
Returns

Definition at line 508 of file SCR_LoadoutManager.c.

◆ GetRandomLoadoutIndex() [2/2]

int GetRandomLoadoutIndex ( Faction faction)
protected
Parameters
[in]faction
Returns

Definition at line 492 of file SCR_LoadoutManager.c.

◆ IsFactionSupportingCsutomLoadouts()

bool IsFactionSupportingCsutomLoadouts ( notnull Faction faction)
protected

Definition at line 360 of file SCR_LoadoutManager.c.

◆ OnPlayerLoadoutCountChanged()

void OnPlayerLoadoutCountChanged ( SCR_BasePlayerLoadout loadout,
int newCount )
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.

Parameters
[in]loadoutThe loadout for which affiliated player count changed.
[in]newCountThe new number of players that are using this loadout.

Definition at line 176 of file SCR_LoadoutManager.c.

◆ OnPlayerLoadoutInfoChanged()

void OnPlayerLoadoutInfoChanged ( )
protected

Update local player loadout mapping.

Definition at line 111 of file SCR_LoadoutManager.c.

◆ OnPlayerLoadoutSet_S()

void OnPlayerLoadoutSet_S ( SCR_PlayerLoadoutComponent playerComponent,
SCR_BasePlayerLoadout loadout )
protected

Authority: Event raised when provided player component has a loadout set.

Definition at line 191 of file SCR_LoadoutManager.c.

◆ SCR_LoadoutManager()

void SCR_LoadoutManager ( IEntitySource src,
IEntity parent )
protected
Parameters
[in]src
[in]parent

Definition at line 569 of file SCR_LoadoutManager.c.

◆ UpdatePlayerLoadout_S()

void UpdatePlayerLoadout_S ( SCR_PlayerLoadoutComponent playerLoadoutComponent)
protected

Authority: Update player loadout info for target player with their up-to-date state.

Parameters
[in]playerLoadoutComponent

Definition at line 202 of file SCR_LoadoutManager.c.

◆ ~SCR_LoadoutManager()

void ~SCR_LoadoutManager ( )
protected

destructor

Definition at line 580 of file SCR_LoadoutManager.c.

Variable Documentation

◆ INVALID_LOADOUT_INDEX

SCR_LoadoutManagerClass INVALID_LOADOUT_INDEX = -1

◆ m_aPlayerLoadoutInfo

ref array<ref SCR_PlayerLoadoutInfo> m_aPlayerLoadoutInfo = {}
protected

List of all player loadout infos in no particular order. Maintained by the authority.

Definition at line 15 of file SCR_LoadoutManager.c.

◆ m_aPlayerLoadouts

ref array<ref SCR_BasePlayerLoadout> m_aPlayerLoadouts
protected

Definition at line 11 of file SCR_LoadoutManager.c.

◆ m_ChangedLoadouts

ref set<int> m_ChangedLoadouts = new set<int>()
protected

List of indices of loadouts whose count has changed since last update.

Definition at line 21 of file SCR_LoadoutManager.c.

◆ m_MappedPlayerLoadoutInfo

ref map<int, ref SCR_PlayerLoadoutInfo> m_MappedPlayerLoadoutInfo = new map<int, ref SCR_PlayerLoadoutInfo>()
protected

Local mapping of playerId to player loadout info.

Definition at line 24 of file SCR_LoadoutManager.c.

◆ m_OnMappedPlayerLoadoutInfoChanged

ref ScriptInvoker<SCR_BasePlayerLoadout, int> m_OnMappedPlayerLoadoutInfoChanged
protected

Definition at line 29 of file SCR_LoadoutManager.c.

◆ m_PlayerCount

ref map<int, int> m_PlayerCount = new map<int, int>()
protected

Mapping of loadout id:player count.

Definition at line 27 of file SCR_LoadoutManager.c.

◆ m_PreviousPlayerLoadouts

ref map<int, int> m_PreviousPlayerLoadouts = new map<int, int>()
protected

Map of previous player <playerId : loadoutIndex>.

Definition at line 18 of file SCR_LoadoutManager.c.