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

Private Member Functions

void SoundLookupTable ()
 
void InitTable (string tableCategoryName, string parameterName)
 
void LoadTable (string soundLookupTableName)
 
SoundObjectBuilder GetSoundBuilder (int parameterHash)
 
void AttachmentSoundLookupTable ()
 
void ImpactSoundLookupTable ()
 

Private Attributes

string m_tableCategoryName
 
string m_parameterName
 
ref map< int, ref array< SoundObjectBuilder > > m_soundBuilders
 

Detailed Description

Definition at line 2 of file DayZAnimEventMaps.c.

Constructor & Destructor Documentation

◆ SoundLookupTable()

void SoundLookupTable::SoundLookupTable ( )
inlineprivate

Definition at line 4 of file DayZAnimEventMaps.c.

5 {
7 }
ref map< int, ref array< SoundObjectBuilder > > m_soundBuilders

References m_soundBuilders.

Member Function Documentation

◆ AttachmentSoundLookupTable()

void SoundLookupTable::AttachmentSoundLookupTable ( )
inlineprivate

Definition at line 85 of file DayZAnimEventMaps.c.

86 {
87 InitTable("CfgAttachmentSoundTables", "category");
88 }
void InitTable(string tableCategoryName, string parameterName)

References InitTable().

◆ GetSoundBuilder()

SoundObjectBuilder SoundLookupTable::GetSoundBuilder ( int parameterHash)
inlineprivate

Definition at line 53 of file DayZAnimEventMaps.c.

54 {
56
57 if (soundObjects == NULL || soundObjects.Count() == 0)
58 return NULL;
59 else if (soundObjects.Count() == 1)
60 return soundObjects.Get(0);
61 else
62 {
63 int index = Math.RandomInt(0, soundObjects.Count());
64 return soundObjects.Get(index);
65 }
66 }
Definition EnMath.c:7
static proto int RandomInt(int min, int max)
Returns a random int number between and min [inclusive] and max [exclusive].

References m_soundBuilders, and Math::RandomInt().

Referenced by EntityAI::PlayImpactSound().

◆ ImpactSoundLookupTable()

void SoundLookupTable::ImpactSoundLookupTable ( )
inlineprivate

Definition at line 114 of file DayZAnimEventMaps.c.

115 {
116 InitTable("CfgImpactSoundTables", "surface");
117 }

References InitTable().

◆ InitTable()

void SoundLookupTable::InitTable ( string tableCategoryName,
string parameterName )
inlineprivate

◆ LoadTable()

void SoundLookupTable::LoadTable ( string soundLookupTableName)
inlineprivate

Definition at line 15 of file DayZAnimEventMaps.c.

16 {
17 string path = "CfgSoundTables " + m_tableCategoryName + " " + soundLookupTableName;
18
19 //load all classes names
20 int soundCount = GetGame().ConfigGetChildrenCount(path);
21
22 for (int i = 0; i < soundCount; i++)
23 {
24 string soundClassName;
25 GetGame().ConfigGetChildName(path, i, soundClassName);
26 string soundClassPath = path + " " + soundClassName + " ";
27
28 string parameter;
30
32 GetGame().ConfigGetTextArray(soundClassPath + "soundSets", soundSetNames);
33
34 //TODO create SoundObject for every entry, save in Game?
36 for (int j = 0; j < soundSetNames.Count(); j++)
37 {
40
43 }
44
45 if (soundObjectBuilders.Count() > 0)
46 {
47 //Print("SoundLookupTable::LoadTable: path: " + path + " param:" + parameter + " param#:" + parameter.Hash() + " objBuildersCount: " + soundObjectBuilders.Count());
49 }
50 }
51 }
static AnimSoundObjectBuilderBank GetInstance()
proto native CGame GetGame()

References GetGame(), AnimSoundObjectBuilderBank::GetInstance(), m_parameterName, m_soundBuilders, m_tableCategoryName, and path.

Member Data Documentation

◆ m_parameterName

string SoundLookupTable::m_parameterName
private

Definition at line 70 of file DayZAnimEventMaps.c.

Referenced by InitTable(), and LoadTable().

◆ m_soundBuilders

ref map<int, ref array<SoundObjectBuilder> > SoundLookupTable::m_soundBuilders
private

Definition at line 71 of file DayZAnimEventMaps.c.

Referenced by GetSoundBuilder(), LoadTable(), and SoundLookupTable().

◆ m_tableCategoryName

string SoundLookupTable::m_tableCategoryName
private

Definition at line 69 of file DayZAnimEventMaps.c.

Referenced by InitTable(), and LoadTable().


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