1 using Microsoft.Xna.Framework;
3 using System.Globalization;
20 [
Serialize(999999.0f,
IsPropertySaveable.Yes, description:
"The output of the item is restricted below this value.", alwaysUseInstanceValues:
true),
21 InGameEditable(MinValueFloat = -999999.0f, MaxValueFloat = 999999.0f)]
28 [
Serialize(-999999.0f,
IsPropertySaveable.Yes, description:
"The output of the item is restricted above this value.", alwaysUseInstanceValues:
true),
29 InGameEditable(MinValueFloat = -999999.0f, MaxValueFloat = 999999.0f)]
37 Serialize(0.0f,
IsPropertySaveable.Yes, description:
"The item must have received signals to both inputs within this timeframe to output the result." +
38 " If set to 0, the inputs must be received at the same time.", alwaysUseInstanceValues:
true, translationTextTag:
"sp.")]
61 bool deactivate =
true;
62 bool earlyReturn =
false;
72 if (earlyReturn) {
return; }
74 if (MathUtils.IsValid(output))
80 protected abstract float Calculate(
float signal1,
float signal2);
84 switch (connection.
Name)
87 float.TryParse(signal.
value, NumberStyles.Float, CultureInfo.InvariantCulture, out
receivedSignal[0]);
93 float.TryParse(signal.
value, NumberStyles.Float, CultureInfo.InvariantCulture, out
receivedSignal[1]);
void SendSignal(string signal, string connectionName)
abstract float Calculate(float signal1, float signal2)
float[] timeSinceReceived
readonly Character[] signalSender
ArithmeticComponent(Item item, ContentXElement element)
override void ReceiveSignal(Signal signal, Connection connection)
sealed override void Update(float deltaTime, Camera cam)
The base class for components holding the different functionalities of the item