Client LuaCsForBarotrauma
NotComponent.cs
1
namespace
Barotrauma.Items.Components
2
{
3
class
NotComponent
:
ItemComponent
4
{
5
private
bool
signalReceived;
6
7
private
bool
continuousOutput;
8
[
InGameEditable
,
Serialize
(
false
,
IsPropertySaveable
.Yes, description:
"When enabled, the component continuously outputs \"1\" when it's not receiving a signal."
, alwaysUseInstanceValues:
true
)]
9
public
bool
ContinuousOutput
10
{
11
get
{
return
continuousOutput; }
12
set
{ continuousOutput =
IsActive
= value; }
13
}
14
15
public
NotComponent
(
Item
item
,
ContentXElement
element)
16
: base (
item
, element)
17
{
18
}
19
20
public
override
void
Update
(
float
deltaTime,
Camera
cam)
21
{
22
base.Update(deltaTime, cam);
23
if
(!signalReceived)
24
{
25
item
.
SendSignal
(
"1"
,
"signal_out"
);
26
}
27
signalReceived =
false
;
28
}
29
30
public
override
void
ReceiveSignal
(
Signal
signal,
Connection
connection)
31
{
32
if
(connection.
Name
!=
"signal_in"
) {
return
; }
33
34
signal.
value
= signal.
value
==
"0"
||
string
.IsNullOrEmpty(signal.
value
) ?
"1"
:
"0"
;
35
signal.
power
= 0.0f;
36
item
.
SendSignal
(signal,
"signal_out"
);
37
signalReceived =
true
;
38
}
39
}
40
}
Barotrauma.Camera
Definition:
Camera.cs:10
Barotrauma.ContentXElement
Definition:
ContentXElement.cs:13
Barotrauma.Item
Definition:
BarotraumaShared/SharedSource/Items/Item.cs:26
Barotrauma.Item.SendSignal
void SendSignal(string signal, string connectionName)
Definition:
BarotraumaShared/SharedSource/Items/Item.cs:2930
Barotrauma.Items.Components.Connection
Definition:
BarotraumaShared/SharedSource/Items/Components/Signal/Connection.cs:10
Barotrauma.Items.Components.Connection.Name
readonly string Name
Definition:
BarotraumaShared/SharedSource/Items/Components/Signal/Connection.cs:20
Barotrauma.Items.Components.ItemComponent
The base class for components holding the different functionalities of the item
Definition:
BarotraumaShared/SharedSource/Items/Components/ItemComponent.cs:35
Barotrauma.Items.Components.ItemComponent.item
Item item
Definition:
BarotraumaShared/SharedSource/Items/Components/ItemComponent.cs:36
Barotrauma.Items.Components.ItemComponent.IsActive
virtual bool? IsActive
Definition:
BarotraumaShared/SharedSource/Items/Components/ItemComponent.cs:114
Barotrauma.Items.Components.NotComponent
Definition:
NotComponent.cs:4
Barotrauma.Items.Components.NotComponent.Update
override void Update(float deltaTime, Camera cam)
Definition:
NotComponent.cs:20
Barotrauma.Items.Components.NotComponent.ContinuousOutput
bool ContinuousOutput
Definition:
NotComponent.cs:10
Barotrauma.Items.Components.NotComponent.NotComponent
NotComponent(Item item, ContentXElement element)
Definition:
NotComponent.cs:15
Barotrauma.Items.Components.NotComponent.ReceiveSignal
override void ReceiveSignal(Signal signal, Connection connection)
Definition:
NotComponent.cs:30
Barotrauma.Serialize
Definition:
SerializableProperty.cs:23
InGameEditable
Definition:
Editable.cs:60
Barotrauma.Items.Components
Definition:
BarotraumaShared/SharedSource/Items/Components/DockingPort.cs:15
Barotrauma.IsPropertySaveable
IsPropertySaveable
Definition:
SerializableProperty.cs:16
Barotrauma.Items.Components.Signal
Definition:
Signal.cs:4
Barotrauma.Items.Components.Signal.power
float power
Definition:
Signal.cs:9
Barotrauma.Items.Components.Signal.value
string value
Definition:
Signal.cs:5
Barotrauma
BarotraumaShared
SharedSource
Items
Components
Signal
NotComponent.cs
Generated by
1.9.1