To Numeric Node - Support converting booleans to numeric

This commit is contained in:
RobertBeekman authored and GitHub committed 2023-02-13 15:52:23 +01:00
1 parent 7a5c018a3f
commit 8dea510eb6
1 file changed
+3 -2
@@ -1,4 +1,4 @@
using Artemis.Core; using Artemis.Core;
namespace Artemis.VisualScripting.Nodes.Conversion; namespace Artemis.VisualScripting.Nodes.Conversion;
@@ -33,6 +33,7 @@ public class ConvertToNumericNode : Node
double input => new Numeric(input), double input => new Numeric(input),
float input => new Numeric(input), float input => new Numeric(input),
byte input => new Numeric(input), byte input => new Numeric(input),
bool input => new Numeric(input ? 1 : 0),
_ => TryParse(Input.Value) _ => TryParse(Input.Value)
}; };
} }
@@ -44,4 +45,4 @@ public class ConvertToNumericNode : Node
} }
#endregion #endregion
} }