8 protected string output, falseOutput;
18 [
InGameEditable(DecimalCount = 2),
Serialize(0.0f,
IsPropertySaveable.Yes, description:
"The item sends the output if both inputs have received a non-zero signal within the timeframe. If set to 0, the inputs must receive a signal at the same time.", alwaysUseInstanceValues:
true)]
32 private int maxOutputLength;
33 [
Editable,
Serialize(200,
IsPropertySaveable.No, description:
"The maximum length of the output strings. Warning: Large values can lead to large memory usage or networking issues.")]
36 get {
return maxOutputLength; }
39 maxOutputLength = Math.Max(value, 0);
49 if (value ==
null) {
return; }
63 get {
return falseOutput; }
66 if (value ==
null) {
return; }
84 protected abstract bool GetOutput(
int numTrueInputs);
88 int receivedInputs = 0;
89 bool allInputsTimedOut =
true;
94 allInputsTimedOut =
false;
101 string signalOut = state ?
output : falseOutput;
102 if (
string.IsNullOrEmpty(signalOut))
105 if (!state && allInputsTimedOut) {
IsActive =
false; }
114 switch (connection.
Name)
117 if (signal.
value ==
"0") {
return; }
123 if (signal.
value ==
"0") {
return; }
void SendSignal(string signal, string connectionName)
sealed override void Update(float deltaTime, Camera cam)
BooleanOperatorComponent(Item item, ContentXElement element)
override void ReceiveSignal(Signal signal, Connection connection)
abstract bool GetOutput(int numTrueInputs)
readonly Character[] signalSender
float[] timeSinceReceived
The base class for components holding the different functionalities of the item