Arma Reforger Explorer 1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Loading...
Searching...
No Matches
SCR_ScenarioFrameworkItemInStorageCondition.c
Go to the documentation of this file.
3{
4 [Attribute(desc: "Entity with storage to check.")]
5 ref SCR_ScenarioFrameworkGet m_Getter;
6
7 [Attribute(desc: "Prefabs to search")]
8 protected ref array <ResourceName> m_aPrefabResources;
9
10 [Attribute(defvalue: "0", desc: "Negation of condition")]
11 protected bool m_bNegation;
12
13 //------------------------------------------------------------------------------------------------
14 override bool Init(IEntity entity)
15 {
16 if (m_bNegation)
17 return !IsInInventory();
18
19 return IsInInventory();
20 }
21
22 //------------------------------------------------------------------------------------------------
23 protected bool IsInInventory()
24 {
25 SCR_ScenarioFrameworkParam<IEntity> entityWrapper = SCR_ScenarioFrameworkParam<IEntity>.Cast(m_Getter.Get());
26 if (!entityWrapper)
27 {
28 Print(string.Format("ScenarioFramework Action: Issue with Getter detected for Action %1.", this), LogLevel.ERROR);
29
30 return false;
31 }
32
33 IEntity storageEntity = entityWrapper.GetValue();
34 if (!storageEntity)
35 return false;
36
38 if (!storageManager)
39 return false;
40
41 //TODO> PrefabFilter would be even better here, to check childrens
42 SCR_PrefabNamePredicate predicate = new SCR_PrefabNamePredicate;
43
44 foreach (ResourceName resource : m_aPrefabResources)
45 {
46 predicate.prefabName = resource;
47 if (storageManager.FindItem(predicate))
48 return true;
49 }
50
51 return false;
52 }
53}
SCR_AIAnimation_Loitering BaseContainerProps
Commanding menu commanding element class.
UI Textures DeployMenu Briefing conflict_HintBanner_1_UI desc
proto external Managed FindComponent(typename typeName)
proto void Print(void var, LogLevel level=LogLevel.NORMAL)
Prints content of variable to console/log.
LogLevel
Enum with severity of the logging message.
Definition LogLevel.c:14
SCR_FieldOfViewSettings Attribute