Arma Reforger Explorer
1.7.0.54
Arma Reforger Code Explorer by Zeroy - Thanks to MisterOutofTime
Toggle main menu visibility
Loading...
Searching...
No Matches
DecoratorScripted_IsEqual.c
Go to the documentation of this file.
1
//------------------------------------------------------------------------------------------------
2
class
DecoratorScripted_IsEqual
:
DecoratorScripted
3
{
4
static
const
string
PORT_VALUE1 =
"value1"
;
5
static
const
string
PORT_VALUE2 =
"value2"
;
6
7
8
protected
override
bool
TestFunction
(AIAgent owner)
9
{
10
if
(
GetVariableType
(
true
, PORT_VALUE1) ==
GetVariableType
(
true
, PORT_VALUE2))
11
{
12
if
(
GetVariableType
(
true
, PORT_VALUE1) ==
int
)
13
{
14
int
value1 = 0;
15
int
value2 = 0;
16
GetVariableIn
(PORT_VALUE1, value1);
17
GetVariableIn
(PORT_VALUE2, value2);
18
19
return
value1 == value2;
20
}
21
else
if
(
GetVariableType
(
true
, PORT_VALUE1) ==
float
)
22
{
23
float
val1 = 0;
24
float
val2 = 0;
25
GetVariableIn
(PORT_VALUE1, val1);
26
GetVariableIn
(PORT_VALUE2, val2);
27
28
return
float
.AlmostEqual(val1, val2);
29
}
30
else
if
(
GetVariableType
(
true
, PORT_VALUE1) ==
bool
)
31
{
32
bool
val1;
33
bool
val2;
34
GetVariableIn
(PORT_VALUE1, val1);
35
GetVariableIn
(PORT_VALUE2, val2);
36
37
return
val1 == val2;
38
}
39
else
if
(
GetVariableType
(
true
, PORT_VALUE1).
IsInherited
(
IEntity
))
40
{
41
IEntity
val1 = null;
42
IEntity
val2 = null;
43
GetVariableIn
(PORT_VALUE1, val1);
44
GetVariableIn
(PORT_VALUE2, val2);
45
46
return
val1 == val2;
47
}
48
else
if
(
GetVariableType
(
true
, PORT_VALUE1).
IsInherited
(Managed))
49
{
50
Managed val1 = null;
51
Managed val2 = null;
52
GetVariableIn
(PORT_VALUE1, val1);
53
GetVariableIn
(PORT_VALUE2, val2);
54
55
return
val1 == val2;
56
}
57
}
58
59
return
false
;
60
}
61
62
protected
static
override
bool
VisibleInPalette
()
63
{
64
return
true
;
65
}
66
67
protected
static
override
string
GetOnHoverDescription
()
68
{
69
return
"DecoratorScripted_IsEqual: Compares whether the given variables are equal. Supports int-int, float-float, bool - bool, IEntity - IEntity and children of Managed comparison"
;
70
}
71
72
protected
static
ref
TStringArray
s_aVarsIn
= {
73
PORT_VALUE1,
74
PORT_VALUE2
75
};
76
protected
override
TStringArray
GetVariablesIn
()
77
{
78
return
s_aVarsIn
;
79
}
80
};
IsInherited
proto native external bool IsInherited(typename type)
DecoratorScripted_IsEqual
Definition
DecoratorScripted_IsEqual.c:3
DecoratorScripted_IsEqual::VisibleInPalette
static override bool VisibleInPalette()
Definition
DecoratorScripted_IsEqual.c:62
DecoratorScripted_IsEqual::GetVariablesIn
override TStringArray GetVariablesIn()
Definition
DecoratorScripted_IsEqual.c:76
DecoratorScripted_IsEqual::s_aVarsIn
static ref TStringArray s_aVarsIn
Definition
DecoratorScripted_IsEqual.c:72
DecoratorScripted_IsEqual::GetOnHoverDescription
static override string GetOnHoverDescription()
Definition
DecoratorScripted_IsEqual.c:67
DecoratorScripted_IsEqual::TestFunction
override bool TestFunction(AIAgent owner)
Definition
DecoratorScripted_IsEqual.c:8
DecoratorScripted
Definition
DecoratorScripted.c:13
IEntity
Definition
IEntity.c:13
Node::GetVariableIn
proto bool GetVariableIn(string name, out void val)
Node::GetVariableType
proto external GetVariableType(bool inputPort, string name)
TStringArray
array< string > TStringArray
Definition
Types.c:385
scripts
Game
AI
ScriptedNodes
Logical
DecoratorScripted_IsEqual.c
Generated by
1.17.0