예제 #1
0
        protected override void Definition()
        {
            values.Clear();

            if (promoteToInputPort)
            {
                binarySave = ValueInput <BinarySave>("binary");
            }

            if (!usePersistantDataPath)
            {
                path = ValueInput <string>("path", string.Empty);
            }
            fileName = ValueInput <string>("fileName", string.Empty);

            complete = ControlOutput("complete");
            DefineSaveControlPort();
            if (!promoteToInputPort)
            {
                DefineVariablePorts();
            }

            binarySaveOut = ValueOutput <BinarySave>("_binary", GetBinaryOutput);

            Requirement(fileName, save);
            Succession(save, complete);
        }
        protected override void Definition()
        {
            enter    = ControlInput("enter", new Action <Flow>(StartSequence));
            breakIn  = ControlInput("break", new Action <Flow>(BreakSequence));
            delay    = ValueInput <float>("delay", 0).AllowsNull();
            unscaled = ValueInput <bool>("unscaled", false);

            Func <Recursion, float> timeElapsed = getTimeElapsed => TimeElapsed();

            elapsed = ValueOutput <float>("elapsed", timeElapsed);

            Func <Recursion, float> timeRemaining = getTimeRemaining => TimeRemaining();

            remaining = ValueOutput <float>("remaining", timeRemaining);

            entered  = ControlOutput("entered");
            loop     = ControlOutput("loop");
            exit     = ControlOutput("exit");
            breakOut = ControlOutput("broken");

            Relation(enter, entered);
            Relation(enter, loop);
            Relation(enter, exit);
            Relation(breakIn, breakOut);
        }
예제 #3
0
 protected override void Definition()
 {
     isControlRoot = true;
     Port          = ValueInput <uint>(nameof(Port), 8000);
     Address       = ValueInput <string>(nameof(Address), "/unity");
     Received      = ControlOutput(nameof(Received));
 }
예제 #4
0
        protected override void Definition()
        {
            enter = ControlInput("enter", (flow) =>
            {
                PerformOperation(flow);
                return(exit);
            });


            collection = ValueInput <IEnumerable>("collection");

            exit = ControlOutput("exit");

            if (Dictionary)
            {
                key = ValueOutput <object>("key");
                Assignment(enter, key);
            }

            value = ValueOutput <object>("item");

            Succession(enter, exit);
            Assignment(enter, value);
            Requirement(collection, enter);
        }
예제 #5
0
        protected override void DefinePorts()
        {
            if (returnType != null)
            {
                if (returnType.IsEnumerable())
                {
                    enter = ControlInput("enter", OnEnterCoroutine);
                    if (yieldable != null)
                    {
                        if (yieldable.@yield)
                        {
                            exit = ControlOutput("exit");
                        }
                    }
                }
                else
                {
                    enter = ControlInput("enter", OnEnter);
                }

                if (returnType != typeof(Void))
                {
                    returns = ValueInput(returnType, "returns");
                }
            }
        }
예제 #6
0
        protected override void DefinePorts()
        {
            base.DefinePorts();

            @true  = ControlOutput("true");
            @false = ControlOutput("false");
            next   = ControlOutput("next");
            enter  = ControlInput("enter", (flow) =>
            {
                if (flow.GetValue <bool>(condition))
                {
                    flow.Invoke(@true);
                }
                else
                {
                    flow.Invoke(@false);
                }
                return(next);
            });

            condition = ValueInput <bool>("condition");

            Requirement(condition, enter);
            Succession(enter, @true);
            Succession(enter, @false);
            Succession(enter, next);
        }
예제 #7
0
    protected override void Definition()
    {
        enter = ControlInput(nameof(enter), Enter);
        exit  = ControlOutput(nameof(exit));

        Succession(enter, exit);
    }
예제 #8
0
        protected override void Definition()
        {
            Enter = ControlInput("Enter", (flow) =>
            {
                delayValue = flow.GetValue <int>(Delay);

                return(Exit);
            });


            Exit     = ControlOutput("Exit");
            Delay    = ValueInput <int>("Delay", 0);
            Title    = ValueInput <string>("Title", string.Empty);
            SubTitle = ValueInput <string>("SubTitle", string.Empty);
            Body     = ValueInput <string>("Body", string.Empty);

            Identifier = ValueOutput <string>("id", (flow) =>
            {
                id = IosNotify(flow.GetValue <int>(Delay), flow.GetValue <string>(Title), flow.GetValue <string>(SubTitle), flow.GetValue <string>(Body));
                return(id);
            });

            Requirement(Title, Enter);
            Requirement(Body, Enter);

            Succession(Enter, Exit);
        }
        /// <summary>
        /// Defines the ports of this unit.
        /// </summary>
        protected override void Definition()
        {
            base.Definition();

            arguments.Clear();

            enter = ControlInput("enter", Enter);

            name = ValueInput <string>("name", string.Empty);

            if (!global)
            {
                target = ValueInput <GameObject>("target", (GameObject)null).NullMeansSelf();
            }

            for (int i = 0; i < count; i++)
            {
                var input = ValueInput <object>(i.ToString());
                arguments.Add(input);
                Requirement(input, enter);
            }

            exit  = ControlOutput("exit");
            value = ValueOutput <object>("value", GetValue);

            Succession(enter, exit);
            Requirement(name, enter);
            if (!global)
            {
                Requirement(target, enter);
            }
            Succession(enter, trigger);
        }
예제 #10
0
        protected override void Definition()
        {
            // Inputs
            on  = ControlInput("on", TurnOn);
            off = ControlInput("off", TurnOff);

            if (showMonitored)
            {
                monitored = ValueInput <K>("monitored", null);
            }

            // Outputs
            m_trigger = ControlOutput("trigger");

            if (showEventArgs)
            {
                eventArgs = ValueOutput("eventArgs", (flow) => { return(m_eventArgs); });
            }

            turnedOn  = ControlOutput("turnedOn");
            turnedOff = ControlOutput("turnedOff");

            // Error handling
            Succession(on, turnedOn);
            Succession(off, turnedOff);
        }
        protected override void Definition()
        {
            isControlRoot = true;

            invoke = ControlOutput("invoke");

            switch (functionType)
            {
            case FunctionType.Method:
                MethodDefinition();
                break;

            case FunctionType.Getter:
                GetterDefinition();
                break;

            case FunctionType.Setter:
                SetterDefinition();
                break;

            case FunctionType.Constructor:
                ConstructorDefinition();
                break;
            }
        }
        protected override void Definition()
        {
            enter = ControlInput("enter", (flow) =>
            {
                if (_delegate is IAction)
                {
                    flow.GetValue <IAction>(a).Bind(flow.GetValue <TDelegateInterface>(b));
                }
                else
                {
                    if (_delegate is IFunc)
                    {
                        flow.GetValue <IFunc>(a).Bind(flow.GetValue <TDelegateInterface>(b));
                    }
                }
                return(exit);
            });

            exit = ControlOutput("exit");

            if (_delegate != null)
            {
                a = ValueInput(_delegate.GetType(), "a");
                b = ValueInput(_delegate.GetType(), "b");
            }
            else
            {
                a = ValueInput(typeof(object), "a");
                b = ValueInput(typeof(object), "b");
            }

            Requirement(a, enter);
            Requirement(b, enter);
            Succession(enter, exit);
        }
예제 #13
0
        protected override void Definition()
        {
            isControlRoot = true;

            parameters.Clear();

            invoke = ControlOutput("invoke");

            if (_delegate != null)
            {
                @delegate = ValueOutput(_delegate.GetType(), "delegate", (flow) =>
                {
                    var _flow = Flow.New(flow.stack.AsReference());
                    InitializeDelegate(_flow, _delegate.initialized);
                    return(_delegate);
                });

                for (int i = 0; i < _delegate.parameters.Length; i++)
                {
                    var index = i;
                    parameters.Add(ValueOutput(_delegate.parameters[i].type, _delegate.parameters[i].name, (flow) =>
                    {
                        return(values[index]);
                    }));
                }
            }
        }
        protected override void Definition()
        {
            enter = ControlInput("enter", new Action <Flow>(Enter));

            name = ValueInput <string>("name", string.Empty);

            if (trigger == TriggerType.Children)
            {
                count = ValueInput <int>("below", 0);
            }
            else if (trigger == TriggerType.Parent)
            {
                count = ValueInput <int>("above", 0);
            }
            else
            {
                if (trigger == TriggerType.Both)
                {
                    count = ValueInput("away", 0);
                }
            }

            for (int i = 0; i < argumentCount; i++)
            {
                int _i = i;
                base.ValueOutput <object>("argument_" + i, (Recursion recursion) => arguments[1 + _i]);
            }

            exit = ControlOutput("exit");

            Relation(enter, exit);
        }
예제 #15
0
        protected override void Definition()
        {
            indexes.Clear();

            enter = ControlInput("enter", SetItem);

            array = ValueInput <Array>("array");

            for (int i = 0; i < dimensions; i++)
            {
                var dimension = ValueInput <int>(i.ToString() + " Index", 0);
                indexes.Add(dimension);
            }

            value = ValueInput <object>("value");

            exit = ControlOutput("exit");

            Succession(enter, exit);

            for (int i = 0; i < indexes.Count; i++)
            {
                Requirement(indexes[i], enter);
            }
        }
예제 #16
0
 public static IEnumerator Yield(Flow flow, ControlOutput next, bool isCoroutine)
 {
     if (isCoroutine)
     {
         yield return(Flow.New(flow.stack.AsReference(), true).Coroutine(next));
     }
 }
예제 #17
0
        protected override void Definition()
        {
            enter = ControlInput(nameof(enter), Enter);
            reset = ControlInput(nameof(reset), Reset);
            exit  = ControlOutput(nameof(exit));

            Relation(enter, exit);
        }
예제 #18
0
 protected override void Definition()
 {
     EnterNode      = ControlInput("EnterNode", DoInjection);
     ExitNode       = ControlOutput("ExitNode");
     Object         = ValueInput <object>("Object");
     Context        = ValueInput <Context>("Context");
     InjectedObject = ValueOutput("InjectedObject", delegate { return(_output); });
 }
예제 #19
0
        protected override void Definition()
        {
            enter = ControlInput("enter", new Action <Flow>(Combine));

            exit = ControlOutput("exit");

            Relation(enter, exit);
        }
예제 #20
0
        protected override void Definition()
        {
            save  = ValueInput <BinarySave>("save");
            enter = ControlInput("enter", (flow) => { flow.GetValue <BinarySave>(save).variables.Clear(); return(exit); });
            exit  = ControlOutput("exit");

            Succession(enter, exit);
        }
예제 #21
0
 protected override void DefinePorts()
 {
     exit  = ControlOutput("exit");
     enter = ControlInput("enter", new System.Func <Flow, ControlOutput>((flow) =>
     {
         LabelUnit.GotoLabel(flow.stack.ToReference(), label, graph);
         return(exit);
     }));
 }
예제 #22
0
 protected override void Definition()
 {
     Enter = ControlInput(nameof(Enter), (flow) =>
     {
         PerformOperation(flow);
         return(Exit);
     });
     Exit = ControlOutput(nameof(Exit));
     Succession(Enter, Exit);
 }
예제 #23
0
        protected override void Definition()
        {
            Enter = ControlInput(nameof(Enter), OnEnter);
            Exit  = ControlOutput(nameof(Exit));
            Succession(Enter, Exit);

            SendTo  = ValueInput <string>(nameof(SendTo), "127.0.0.1");
            Port    = ValueInput <uint>(nameof(Port), 9000);
            Address = ValueInput <string>(nameof(Address), "/unity");
        }
예제 #24
0
        protected override void DefinePorts()
        {
            enter = ControlInput("enter", new System.Func <Flow, ControlOutput>((flow) =>
            {
                OnCase(flow);
                return(next);
            }));

            next = ControlOutput("next");
        }
        protected override void Definition()
        {
            enter = ControlInput(nameof(enter), Enter);
            reset = ControlInput(nameof(reset), Reset);
            once  = ControlOutput(nameof(once));
            after = ControlOutput(nameof(after));

            Succession(enter, once);
            Succession(enter, after);
        }
예제 #26
0
 protected override void Definition()
 {
     EnterNode      = ControlInput("EnterNode", DoInjection);
     ExitNode       = ControlOutput("ExitNode");
     Prototype      = ValueInput <Object>("Prototype", null);
     Context        = ValueInput <Context>("Context", null);
     Position       = ValueInput <Vector3>("Position", Vector3.zero);
     Orientation    = ValueInput <Quaternion>("Orientation", Quaternion.identity);
     InjectedObject = ValueOutput("InjectedObject", delegate { return(_output); });
 }
    protected override void Definition()
    {
        enter = ControlInput(nameof(enter), InputKey);

        up   = ControlOutput(nameof(up));
        down = ControlOutput(nameof(down));

        Succession(enter, up);
        Succession(enter, down);
    }
예제 #28
0
        protected override void Definition()
        {
            enter     = ControlInput(nameof(enter), Enter);
            input     = ValueInput <object>(nameof(input));
            lastValue = ValueOutput <object>(nameof(lastValue), (x) => _previous);
            onChange  = ControlOutput(nameof(onChange));

            Relation(enter, onChange);
            Relation(input, onChange);
        }
예제 #29
0
        protected override void Definition()
        {
            enter     = ControlInput(nameof(enter), Enter);
            input     = ValueInput <object>(nameof(input));
            lastValue = ValueOutput <object>(nameof(lastValue));
            onChange  = ControlOutput(nameof(onChange));

            Succession(enter, onChange);
            Requirement(input, enter);
        }
예제 #30
0
        private static ControlOutput InitializeControlOutput()
        {
            ControlOutput initialControl = new ControlOutput
            {
                Thrust      = new Vector3D <float>(0, 0, 0),
                PyroOutputs = 0x00
            };

            return(initialControl);
        }