Client LuaCsForBarotrauma
CheckTraitorEventStateAction.cs
1
#nullable enable
2
3
namespace
Barotrauma
4
{
8
class
CheckTraitorEventStateAction
:
BinaryOptionAction
9
{
10
[
Serialize
(
TraitorEvent
.
State
.Completed,
IsPropertySaveable
.Yes, description:
"What does the state of the event need to be for the check to succeed?"
)]
11
public
TraitorEvent
.
State
State
{
get
;
set
; }
12
13
private
readonly
TraitorEvent
? traitorEvent;
14
15
public
CheckTraitorEventStateAction
(
ScriptedEvent
parentEvent,
ContentXElement
element) : base(parentEvent, element)
16
{
17
if
(parentEvent is
TraitorEvent
traitorEvent)
18
{
19
this.traitorEvent = traitorEvent;
20
}
21
else
22
{
23
DebugConsole.ThrowError($
"Cannot use the action {nameof(CheckTraitorEventStateAction)} in the event \"{parentEvent.Prefab.Identifier}\" because it's not a traitor event."
,
24
contentPackage: element.
ContentPackage
);
25
}
26
}
27
28
protected
override
bool
?
DetermineSuccess
()
29
{
30
return
traitorEvent?.CurrentState ==
State
;
31
}
32
33
public
override
string
ToDebugString
()
34
{
35
return
$
"{ToolBox.GetDebugSymbol(HasBeenDetermined())} {nameof(CheckTraitorEventStateAction)} -> "
+
36
$
"State: {State.ColorizeObject()}, Succeeded: {succeeded.ColorizeObject()})"
;
37
}
38
}
39
}
Barotrauma.BinaryOptionAction
Definition:
BinaryOptionAction.cs:8
Barotrauma.CheckTraitorEventStateAction
Check the state of the traitor event the action is defined in. Only valid for traitor events.
Definition:
CheckTraitorEventStateAction.cs:9
Barotrauma.CheckTraitorEventStateAction.State
TraitorEvent.State State
Definition:
CheckTraitorEventStateAction.cs:11
Barotrauma.CheckTraitorEventStateAction.DetermineSuccess
override? bool DetermineSuccess()
Definition:
CheckTraitorEventStateAction.cs:28
Barotrauma.CheckTraitorEventStateAction.ToDebugString
override string ToDebugString()
Rich test to display in debugdraw
Definition:
CheckTraitorEventStateAction.cs:33
Barotrauma.CheckTraitorEventStateAction.CheckTraitorEventStateAction
CheckTraitorEventStateAction(ScriptedEvent parentEvent, ContentXElement element)
Definition:
CheckTraitorEventStateAction.cs:15
Barotrauma.ContentXElement
Definition:
ContentXElement.cs:13
Barotrauma.ContentXElement.ContentPackage
ContentPackage? ContentPackage
Definition:
ContentXElement.cs:14
Barotrauma.ScriptedEvent
Definition:
ScriptedEvent.cs:9
Barotrauma.Serialize
Definition:
SerializableProperty.cs:23
Barotrauma.TraitorEvent
Definition:
TraitorEvent.cs:10
Barotrauma.TraitorEvent.State
State
Definition:
TraitorEvent.cs:12
Barotrauma
Definition:
AchievementManager.cs:12
Barotrauma.IsPropertySaveable
IsPropertySaveable
Definition:
SerializableProperty.cs:16
Barotrauma
BarotraumaShared
SharedSource
Events
EventActions
CheckTraitorEventStateAction.cs
Generated by
1.9.1