2 using System.Globalization;
33 if (connection.
Name !=
"signal_in") {
return; }
34 if (!
float.TryParse(signal.
value, NumberStyles.Float, CultureInfo.InvariantCulture, out
float value)) {
return; }
38 value = MathF.Round(value);
45 value = MathF.Ceiling(value);
52 value = MathF.Floor(value);
55 int intVal = (int)Math.Min(value, 20);
57 for (
int i = intVal; i > 0; i--)
59 factorial *= (ulong)i;
64 value = MathF.Abs(value);
71 value = MathF.Sqrt(value);
74 throw new NotImplementedException($
"Function {Function} has not been implemented.");
77 signal.
value = value.ToString(
"G", CultureInfo.InvariantCulture);
void SendSignal(string signal, string connectionName)
FunctionComponent(Item item, ContentXElement element)
override void ReceiveSignal(Signal signal, Connection connection)
The base class for components holding the different functionalities of the item