Arma Reforger Explorer  1.1.0.42
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
SCR_ScriptInvokerHelper.c
Go to the documentation of this file.
1 //------------------------------------------------------------------------------------------------
2 // Generic Script invokers. To be used in any script that does not need specific invokers
3 // If a series of types comes up often, it is good to add it here (under a generic name)
4 //------------------------------------------------------------------------------------------------
5 
6 // default no parameters type
9 typedef ScriptInvokerBase<ScriptInvokerVoidMethod> ScriptInvokerVoid;
10 
11 // common values
12 
13 // int
14 void ScriptInvokerIntMethod(int i);
15 void ScriptInvokerInt2Method(int i1, int i2);
16 void ScriptInvokerInt3Method(int i1, int i2, int i3);
17 void ScriptInvokerInt4Method(int i1, int i2, int i3, int i4);
18 void ScriptInvokerInt5Method(int i1, int i2, int i3, int i4, int i5);
24 typedef ScriptInvokerBase<ScriptInvokerIntMethod> ScriptInvokerInt;
25 typedef ScriptInvokerBase<ScriptInvokerInt2Method> ScriptInvokerInt2;
26 typedef ScriptInvokerBase<ScriptInvokerInt3Method> ScriptInvokerInt3;
27 typedef ScriptInvokerBase<ScriptInvokerInt4Method> ScriptInvokerInt4;
28 typedef ScriptInvokerBase<ScriptInvokerInt5Method> ScriptInvokerInt5;
29 
30 // bool
31 void ScriptInvokerBoolMethod(bool b);
32 void ScriptInvokerBool2Method(bool b1, bool b2);
33 void ScriptInvokerBool3Method(bool b1, bool b2, bool b3);
34 void ScriptInvokerBool4Method(bool b1, bool b2, bool b3, bool b4);
35 void ScriptInvokerBool5Method(bool b1, bool b2, bool b3, bool b4, bool b5);
41 typedef ScriptInvokerBase<ScriptInvokerBoolMethod> ScriptInvokerBool;
42 typedef ScriptInvokerBase<ScriptInvokerBool2Method> ScriptInvokerBool2;
43 typedef ScriptInvokerBase<ScriptInvokerBool3Method> ScriptInvokerBool3;
44 typedef ScriptInvokerBase<ScriptInvokerBool4Method> ScriptInvokerBool4;
45 typedef ScriptInvokerBase<ScriptInvokerBool5Method> ScriptInvokerBool5;
46 
47 // float
48 void ScriptInvokerFloatMethod(float f);
49 void ScriptInvokerFloat2Method(float f1, float f2);
50 void ScriptInvokerFloat3Method(float f1, float f2, float f3);
51 void ScriptInvokerFloat4Method(float f1, float f2, float f3, float f4);
52 void ScriptInvokerFloat5Method(float f1, float f2, float f3, float f4, float f5);
58 typedef ScriptInvokerBase<ScriptInvokerFloatMethod> ScriptInvokerFloat;
59 typedef ScriptInvokerBase<ScriptInvokerFloat2Method> ScriptInvokerFloat2;
60 typedef ScriptInvokerBase<ScriptInvokerFloat3Method> ScriptInvokerFloat3;
61 typedef ScriptInvokerBase<ScriptInvokerFloat4Method> ScriptInvokerFloat4;
62 typedef ScriptInvokerBase<ScriptInvokerFloat5Method> ScriptInvokerFloat5;
63 
64 // string
65 void ScriptInvokerStringMethod(string s);
66 void ScriptInvokerString2Method(string s1, string s2);
67 void ScriptInvokerString3Method(string s1, string s2, string s3);
68 void ScriptInvokerString4Method(string s1, string s2, string s3, string s4);
69 void ScriptInvokerString5Method(string s1, string s2, string s3, string s4, string s5);
75 typedef ScriptInvokerBase<ScriptInvokerStringMethod> ScriptInvokerString;
76 typedef ScriptInvokerBase<ScriptInvokerString2Method> ScriptInvokerString2;
77 typedef ScriptInvokerBase<ScriptInvokerString3Method> ScriptInvokerString3;
78 typedef ScriptInvokerBase<ScriptInvokerString4Method> ScriptInvokerString4;
79 typedef ScriptInvokerBase<ScriptInvokerString5Method> ScriptInvokerString5;
80 
81 // IEntity
82 void ScriptInvokerEntityMethod(IEntity e);
83 void ScriptInvokerEntity2Method(IEntity e1, IEntity e2);
84 //void ScriptInvokerEntity3Method(IEntity e1, IEntity e2, IEntity e3);
85 //void ScriptInvokerEntity4Method(IEntity e1, IEntity e2, IEntity e3, IEntity e4);
86 //void ScriptInvokerEntity5Method(IEntity e1, IEntity e2, IEntity e3, IEntity e4, IEntity e5);
89 //typedef func ScriptInvokerEntity3Method;
90 //typedef func ScriptInvokerEntity4Method;
91 //typedef func ScriptInvokerEntity5Method;
92 typedef ScriptInvokerBase<ScriptInvokerEntityMethod> ScriptInvokerEntity;
93 typedef ScriptInvokerBase<ScriptInvokerEntity2Method> ScriptInvokerEntity2;
94 //typedef ScriptInvokerBase<ScriptInvokerEntity3Method> ScriptInvokerEntity3;
95 //typedef ScriptInvokerBase<ScriptInvokerEntity4Method> ScriptInvokerEntity4;
96 //typedef ScriptInvokerBase<ScriptInvokerEntity5Method> ScriptInvokerEntity5;
97 
98 // vector
99 void ScriptInvokerVectorMethod(vector v);
101 typedef ScriptInvokerBase<ScriptInvokerVectorMethod> ScriptInvokerVector;
102 
103 // Widget
104 void ScriptInvokerWidgetMethod(Widget w);
106 typedef ScriptInvokerBase<ScriptInvokerWidgetMethod> ScriptInvokerWidget;
107 
108 // SCR_ScriptedWidgetComponent
111 typedef ScriptInvokerBase<ScriptInvokerSCRScriptedWidgetComponentMethod> ScriptInvokerSCRScriptedWidgetComponent;
112 
113 // BaseWorld
114 void ScriptInvokerBaseWorldMethod(BaseWorld w);
116 typedef ScriptInvokerBase<ScriptInvokerBaseWorldMethod> ScriptInvokerBaseWorld;
117 
118 // RplId
119 void ScriptInvokerRplIdMethod(RplId id);
121 typedef ScriptInvokerBase<ScriptInvokerRplIdMethod> ScriptInvokerRplId;
122 
123 //IEntity and BaseInventoryStorageComponent
124 void ScriptInvokerEntityAndStorageMethod(IEntity entity, BaseInventoryStorageComponent storageComponent);
126 typedef ScriptInvokerBase<ScriptInvokerEntityAndStorageMethod> ScriptInvokerEntityAndStorage;
127 
128 // this is an example class to show how to define and use script invokers
129 /*
130 class SCR_ExampleClass
131 {
132  // define the event
133  protected ref ScriptInvokerInt m_OnExampleEvent;
134 
135  // return script invoker
136  ScriptInvokerInt GetOnExampleEvent()
137  {
138  if (!m_OnExampleEvent)
139  m_OnExampleEvent = new ScriptInvokerInt();
140 
141  return m_OnExampleEvent;
142  }
143 
144  protected void ExampleInvoke()
145  {
146  int exampleInt;
147  if (m_OnExampleEvent) // null if nobody subscribed to it from the outside
148  m_OnExampleEvent.Invoke(exampleInt);
149  }
150 
151  protected void MyExampleFunction(int exampleInt)
152  {
153  Print(string.Format("I was executed %1", exampleInt), LogLevel.VERBOSE);
154  }
155 
156  protected void ExampleInsert()
157  {
158  SCR_ExampleClass exampleClass; // get this from somewhere
159  // ...
160  exampleClass.GetOnExampleEvent().Insert(MyExampleFunction);
161  }
162 
163  protected void ExampleRemove()
164  {
165  SCR_ExampleClass exampleClass; // get this from somewhere
166  // ...
167  exampleClass.GetOnExampleEvent().Remove(MyExampleFunction);
168  }
169 }
170 */
ScriptInvokerString5
ScriptInvokerBase< ScriptInvokerString5Method > ScriptInvokerString5
Definition: SCR_ScriptInvokerHelper.c:79
ScriptInvokerEntity2
ScriptInvokerBase< ScriptInvokerEntity2Method > ScriptInvokerEntity2
Definition: SCR_ScriptInvokerHelper.c:93
ScriptInvokerString2Method
func ScriptInvokerString2Method
Definition: SCR_ScriptInvokerHelper.c:71
ScriptInvokerFloat3
ScriptInvokerBase< ScriptInvokerFloat3Method > ScriptInvokerFloat3
Definition: SCR_ScriptInvokerHelper.c:60
ScriptInvokerString4Method
func ScriptInvokerString4Method
Definition: SCR_ScriptInvokerHelper.c:73
ScriptInvokerFloat5Method
func ScriptInvokerFloat5Method
Definition: SCR_ScriptInvokerHelper.c:57
ScriptInvokerInt3
ScriptInvokerBase< ScriptInvokerInt3Method > ScriptInvokerInt3
Definition: SCR_ScriptInvokerHelper.c:26
ScriptInvokerInt2
ScriptInvokerBase< ScriptInvokerInt2Method > ScriptInvokerInt2
Definition: SCR_ScriptInvokerHelper.c:25
ScriptInvokerString4
ScriptInvokerBase< ScriptInvokerString4Method > ScriptInvokerString4
Definition: SCR_ScriptInvokerHelper.c:78
ScriptInvokerInt4
ScriptInvokerBase< ScriptInvokerInt4Method > ScriptInvokerInt4
Definition: SCR_ScriptInvokerHelper.c:27
ScriptInvokerInt
ScriptInvokerBase< ScriptInvokerIntMethod > ScriptInvokerInt
Definition: SCR_ScriptInvokerHelper.c:24
ScriptInvokerBool2
ScriptInvokerBase< ScriptInvokerBool2Method > ScriptInvokerBool2
Definition: SCR_ScriptInvokerHelper.c:42
ScriptInvokerSCRScriptedWidgetComponentMethod
func ScriptInvokerSCRScriptedWidgetComponentMethod
Definition: SCR_ScriptInvokerHelper.c:110
ScriptInvokerEntityAndStorageMethod
func ScriptInvokerEntityAndStorageMethod
Definition: SCR_ScriptInvokerHelper.c:125
ScriptInvokerStringMethod
func ScriptInvokerStringMethod
Definition: SCR_ScriptInvokerHelper.c:70
ScriptInvokerFloat2
ScriptInvokerBase< ScriptInvokerFloat2Method > ScriptInvokerFloat2
Definition: SCR_ScriptInvokerHelper.c:59
ScriptInvokerString3
ScriptInvokerBase< ScriptInvokerString3Method > ScriptInvokerString3
Definition: SCR_ScriptInvokerHelper.c:77
ScriptInvokerBool3
ScriptInvokerBase< ScriptInvokerBool3Method > ScriptInvokerBool3
Definition: SCR_ScriptInvokerHelper.c:43
ScriptInvokerString3Method
func ScriptInvokerString3Method
Definition: SCR_ScriptInvokerHelper.c:72
ScriptInvokerFloat4Method
func ScriptInvokerFloat4Method
Definition: SCR_ScriptInvokerHelper.c:56
ScriptInvokerBool2Method
func ScriptInvokerBool2Method
Definition: SCR_ScriptInvokerHelper.c:37
func
func
Definition: SCR_AIThreatSystem.c:5
ScriptInvokerWidgetMethod
func ScriptInvokerWidgetMethod
Definition: SCR_ScriptInvokerHelper.c:105
ScriptInvokerInt4Method
func ScriptInvokerInt4Method
Definition: SCR_ScriptInvokerHelper.c:22
ScriptInvokerBaseWorldMethod
func ScriptInvokerBaseWorldMethod
Definition: SCR_ScriptInvokerHelper.c:115
ScriptInvokerIntMethod
func ScriptInvokerIntMethod
Definition: SCR_ScriptInvokerHelper.c:19
ScriptInvokerInt5Method
func ScriptInvokerInt5Method
Definition: SCR_ScriptInvokerHelper.c:23
ScriptInvokerFloat
ScriptInvokerBase< ScriptInvokerFloatMethod > ScriptInvokerFloat
Definition: SCR_ScriptInvokerHelper.c:58
ScriptInvokerVectorMethod
func ScriptInvokerVectorMethod
Definition: SCR_ScriptInvokerHelper.c:100
ScriptInvokerBool
ScriptInvokerBase< ScriptInvokerBoolMethod > ScriptInvokerBool
Definition: SCR_ScriptInvokerHelper.c:41
ScriptInvokerString
ScriptInvokerBase< ScriptInvokerStringMethod > ScriptInvokerString
Definition: SCR_ScriptInvokerHelper.c:75
ScriptInvokerBaseWorld
ScriptInvokerBase< ScriptInvokerBaseWorldMethod > ScriptInvokerBaseWorld
Definition: SCR_ScriptInvokerHelper.c:116
ScriptInvokerEntity2Method
func ScriptInvokerEntity2Method
Definition: SCR_ScriptInvokerHelper.c:88
ScriptInvokerEntity
ScriptInvokerBase< ScriptInvokerEntityMethod > ScriptInvokerEntity
Definition: SCR_ScriptInvokerHelper.c:92
ScriptInvokerRplIdMethod
func ScriptInvokerRplIdMethod
Definition: SCR_ScriptInvokerHelper.c:120
ScriptInvokerString5Method
func ScriptInvokerString5Method
Definition: SCR_ScriptInvokerHelper.c:74
ScriptInvokerBool4Method
func ScriptInvokerBool4Method
Definition: SCR_ScriptInvokerHelper.c:39
ScriptInvokerBool4
ScriptInvokerBase< ScriptInvokerBool4Method > ScriptInvokerBool4
Definition: SCR_ScriptInvokerHelper.c:44
ScriptInvokerInt2Method
func ScriptInvokerInt2Method
Definition: SCR_ScriptInvokerHelper.c:20
ScriptInvokerEntityAndStorage
ScriptInvokerBase< ScriptInvokerEntityAndStorageMethod > ScriptInvokerEntityAndStorage
Definition: SCR_ScriptInvokerHelper.c:126
ScriptInvokerString2
ScriptInvokerBase< ScriptInvokerString2Method > ScriptInvokerString2
Definition: SCR_ScriptInvokerHelper.c:76
ScriptInvokerSCRScriptedWidgetComponent
ScriptInvokerBase< ScriptInvokerSCRScriptedWidgetComponentMethod > ScriptInvokerSCRScriptedWidgetComponent
Definition: SCR_ScriptInvokerHelper.c:111
ScriptInvokerVector
ScriptInvokerBase< ScriptInvokerVectorMethod > ScriptInvokerVector
Definition: SCR_ScriptInvokerHelper.c:101
ScriptInvokerFloatMethod
func ScriptInvokerFloatMethod
Definition: SCR_ScriptInvokerHelper.c:53
ScriptInvokerFloat4
ScriptInvokerBase< ScriptInvokerFloat4Method > ScriptInvokerFloat4
Definition: SCR_ScriptInvokerHelper.c:61
ScriptInvokerFloat3Method
func ScriptInvokerFloat3Method
Definition: SCR_ScriptInvokerHelper.c:55
ScriptInvokerFloat2Method
func ScriptInvokerFloat2Method
Definition: SCR_ScriptInvokerHelper.c:54
ScriptInvokerVoid
ScriptInvokerBase< ScriptInvokerVoidMethod > ScriptInvokerVoid
Definition: SCR_ScriptInvokerHelper.c:9
ScriptInvokerEntityMethod
func ScriptInvokerEntityMethod
Definition: SCR_ScriptInvokerHelper.c:87
ScriptInvokerWidget
ScriptInvokerBase< ScriptInvokerWidgetMethod > ScriptInvokerWidget
Definition: SCR_ScriptInvokerHelper.c:106
ScriptInvokerBool3Method
func ScriptInvokerBool3Method
Definition: SCR_ScriptInvokerHelper.c:38
ScriptInvokerInt5
ScriptInvokerBase< ScriptInvokerInt5Method > ScriptInvokerInt5
Definition: SCR_ScriptInvokerHelper.c:28
ScriptInvokerFloat5
ScriptInvokerBase< ScriptInvokerFloat5Method > ScriptInvokerFloat5
Definition: SCR_ScriptInvokerHelper.c:62
SCR_ScriptedWidgetComponent
Definition: SCR_ScriptedWidgetComponent.c:7
ScriptInvokerInt3Method
func ScriptInvokerInt3Method
Definition: SCR_ScriptInvokerHelper.c:21
ScriptInvokerRplId
ScriptInvokerBase< ScriptInvokerRplIdMethod > ScriptInvokerRplId
Definition: SCR_ScriptInvokerHelper.c:121
ScriptInvokerBool5Method
func ScriptInvokerBool5Method
Definition: SCR_ScriptInvokerHelper.c:40
ScriptInvokerBoolMethod
func ScriptInvokerBoolMethod
Definition: SCR_ScriptInvokerHelper.c:36
ScriptInvokerBool5
ScriptInvokerBase< ScriptInvokerBool5Method > ScriptInvokerBool5
Definition: SCR_ScriptInvokerHelper.c:45
ScriptInvokerVoidMethod
func ScriptInvokerVoidMethod
Definition: SCR_ScriptInvokerHelper.c:8