Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
SCR_AnalyticsDataCollectionHelper.c
Go to the documentation of this file.
1
class
SCR_AnalyticsDataCollectionHelper
2
{
3
//------------------------------------------------------------------------------------------------
7
static
string
GetEntityPrefabName(notnull
IEntity
entity)
8
{
9
string
entityName;
10
11
EntityPrefabData
entityPrefabData = entity.GetPrefabData();
12
if
(!entityPrefabData)
13
return
entityName;
14
15
entityName = entityPrefabData.GetPrefab().GetName();
16
17
return
GetShortEntityPrefabName(entityName);
18
}
19
20
//------------------------------------------------------------------------------------------------
25
static
int
GetEntitySupplyCost(
IEntity
entity)
26
{
27
SCR_EditableEntityComponent
editableEntityComponent =
SCR_EditableEntityComponent
.
GetEditableEntity
(entity);
28
if
(!editableEntityComponent)
29
return
0;
30
31
array<ref SCR_EntityBudgetValue> budgets = {};
32
editableEntityComponent.
GetEntityBudgetCost
(budgets, entity);
33
34
foreach
(
SCR_EntityBudgetValue
budget : budgets)
35
{
36
// We only care about Campaign budget
37
if
(budget.GetBudgetType() ==
EEditableEntityBudget
.CAMPAIGN)
38
return
budget.GetBudgetValue();
39
}
40
41
return
0;
42
}
43
44
//------------------------------------------------------------------------------------------------
48
static
string
GetShortEntityPrefabName(
string
entityPrefabName)
49
{
50
array<string> pieces = {};
51
entityPrefabName.Split(
"/"
, pieces,
true
);
52
53
string
shortName;
54
if
(pieces.Count() > 0)
55
shortName = pieces[pieces.Count() - 1];
56
57
return
shortName;
58
}
59
60
//------------------------------------------------------------------------------------------------
64
static
string
GetShortDataArray(
string
dataArray)
65
{
66
int
firstWhiteSpaceIndex = dataArray.IndexOf(
" "
);
67
if
(firstWhiteSpaceIndex < 1)
68
return
string
.Empty;
69
70
return
dataArray.Substring(firstWhiteSpaceIndex +1, dataArray.Length() - 1 - firstWhiteSpaceIndex);
71
}
72
73
//------------------------------------------------------------------------------------------------
77
static
string
GetShortModuleName(
string
moduleName)
78
{
79
array<string> pieces = {};
80
moduleName.Split(
"<"
, pieces,
true
);
81
82
string
shortName;
83
84
if
(pieces.Count() > 0)
85
shortName = pieces[0];
86
87
shortName.Split(
"_"
, pieces,
true
);
88
89
if
(pieces.Count() > 0)
90
shortName = pieces[pieces.Count() - 1];
91
92
return
shortName;
93
}
94
}
EEditableEntityBudget
EEditableEntityBudget
Definition
EEditableEntityBudget.c:2
EntityPrefabData
Definition
EntityPrefabData.c:19
IEntity
Definition
IEntity.c:13
SCR_AnalyticsDataCollectionHelper
Definition
SCR_AnalyticsDataCollectionHelper.c:2
SCR_EditableEntityComponent
Definition
SCR_EditableEntityComponent.c:14
SCR_EditableEntityComponent::GetEditableEntity
static SCR_EditableEntityComponent GetEditableEntity(IEntity owner)
Definition
SCR_EditableEntityComponent.c:919
SCR_EditableEntityComponent::GetEntityBudgetCost
bool GetEntityBudgetCost(out notnull array< ref SCR_EntityBudgetValue > outBudgets, IEntity owner=null)
Definition
SCR_EditableEntityComponent.c:932
SCR_EntityBudgetValue
Definition
SCR_EntityBudgetValue.c:3
scripts
Game
DataCollection
SCR_AnalyticsDataCollectionHelper.c
Generated by
1.17.0