Run If True/False


Node Information
Fires 'True' when the given value is TRUE, and fires 'False' when the given value is FALSE.
General Information
• This node doesn't have other available options.
Visual
Visual

Ports
Text Type DataType Accepts IsList CustomAcception
Compare IN RUN MULTIPLE FALSE FALSE
Variable IN Boolean ONE FALSE FALSE
True OUT RUN MULTIPLE FALSE FALSE
False OUT RUN MULTIPLE FALSE FALSE

Source
namespace Korduene.KGraph.Nodes.Conditions
{
    [IsNode("Run If True/False")]
    public class RunIfTrueFalse : Node
    {
        Port run = new Port(PortType.IN, typeof(RUN), AcceptsLinks.MULTIPLE, "Compare");
        Port a = new Port(PortType.IN, typeof(bool), AcceptsLinks.ONE, "Variable");
        Port runouttr = new Port(PortType.OUT, typeof(RUN), AcceptsLinks.MULTIPLE, "True");
        Port runoutfl = new Port(PortType.OUT, typeof(RUN), AcceptsLinks.MULTIPLE, "False");
        public bool Bool
        {
            set { a.Value = value.ToString(); }
            get { return GetRuntimeValue(a); }
        }
        public RunIfTrueFalse()
        {
            this.Name = "Run If True/False";
            this.NodeType = KGraph.NodeType.Method;
            AddPort(run);
            AddPort(a);
            AddPort(runouttr);
            AddPort(runoutfl);
            Information = "Fires 'True' when the given value is TRUE, and fires 'False' when the given value is FALSE.";
        }
        public override string Code()
        {
            return "if(" + GetValue(a) + ")\r\n{\r\n" + GetValue(runouttr) + "}\r\n else\r\n{\r\n" + GetValue(runoutfl) + "}";
        }
    }
}