DayZ 1.24
Loading...
Searching...
No Matches
PlayerSpawnPreset Class Reference
Inheritance diagram for PlayerSpawnPreset:
[legend]
Collaboration diagram for PlayerSpawnPreset:
[legend]

Private Member Functions

string GetRandomCharacterType ()
 
override bool IsValid ()
 
bool HasAttachmentSlotSetsDefined ()
 preset might be valid even with no attachmentSlotItemSets configured, checked separately
 
bool HasDiscreteUnsortedItemSetsDefined ()
 preset might be valid even with no unsorted item sets configured, checked separately
 

Private Attributes

int spawnWeight
 
string name
 
ref array< stringcharacterTypes
 
ref array< ref PlayerSpawnPresetSlotDataattachmentSlotItemSets
 
ref array< ref PlayerSpawnPresetDiscreteCargoSetDatadiscreteUnsortedItemSets
 

Detailed Description

Definition at line 16 of file CfgPlayerSpawnDataJson.c.

Member Function Documentation

◆ GetRandomCharacterType()

string PlayerSpawnPreset::GetRandomCharacterType ( )
inlineprivate

Definition at line 24 of file CfgPlayerSpawnDataJson.c.

25 {
26 if (characterTypes && characterTypes.Count() > 0)
27 return characterTypes.GetRandomElement();
28
29 Debug.Log("No characterTypes defined. Falling back to 'default' character type, or random, if undefined", "n/a", "n/a", "PlayerSpawnPreset");
30 return string.Empty;
31 }
Definition Debug.c:14
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Definition Debug.c:133
ref array< string > characterTypes

References characterTypes, and Debug::Log().

◆ HasAttachmentSlotSetsDefined()

bool PlayerSpawnPreset::HasAttachmentSlotSetsDefined ( )
inlineprivate

preset might be valid even with no attachmentSlotItemSets configured, checked separately

Definition at line 48 of file CfgPlayerSpawnDataJson.c.

49 {
51 }
ref array< ref PlayerSpawnPresetSlotData > attachmentSlotItemSets

References attachmentSlotItemSets.

◆ HasDiscreteUnsortedItemSetsDefined()

bool PlayerSpawnPreset::HasDiscreteUnsortedItemSetsDefined ( )
inlineprivate

preset might be valid even with no unsorted item sets configured, checked separately

Definition at line 54 of file CfgPlayerSpawnDataJson.c.

55 {
57 }
ref array< ref PlayerSpawnPresetDiscreteCargoSetData > discreteUnsortedItemSets

References discreteUnsortedItemSets.

◆ IsValid()

override bool PlayerSpawnPreset::IsValid ( )
inlineprivate

Definition at line 33 of file CfgPlayerSpawnDataJson.c.

34 {
35 if (!super.IsValid())
36 return false;
37
38 if (spawnWeight < 1)
39 {
40 Debug.Log("Invalid spawn weight, skipping preset: " + name, "n/a", "Validation", "PlayerSpawnPreset");
41 return false;
42 }
43
44 return true;
45 }

References Debug::Log(), name, and spawnWeight.

Member Data Documentation

◆ attachmentSlotItemSets

ref array<ref PlayerSpawnPresetSlotData> PlayerSpawnPreset::attachmentSlotItemSets
private

Definition at line 21 of file CfgPlayerSpawnDataJson.c.

Referenced by HasAttachmentSlotSetsDefined().

◆ characterTypes

ref array<string> PlayerSpawnPreset::characterTypes
private

Definition at line 20 of file CfgPlayerSpawnDataJson.c.

Referenced by GetRandomCharacterType().

◆ discreteUnsortedItemSets

ref array<ref PlayerSpawnPresetDiscreteCargoSetData> PlayerSpawnPreset::discreteUnsortedItemSets
private

Definition at line 22 of file CfgPlayerSpawnDataJson.c.

Referenced by HasDiscreteUnsortedItemSetsDefined().

◆ name

string PlayerSpawnPreset::name
private

Definition at line 19 of file CfgPlayerSpawnDataJson.c.

Referenced by IsValid().

◆ spawnWeight

int PlayerSpawnPreset::spawnWeight
private

Definition at line 18 of file CfgPlayerSpawnDataJson.c.

Referenced by IsValid().


The documentation for this class was generated from the following file: