コード例 #1
0
        public static TronicSequence StartFromReciever(DataNodeIn Channel, DataNodeOut Username, DataNodeOut Message, N8BlockFactory Blocks = null, string name = "Reciever")
        {
            TronicSequence ts = new TronicSequence(Blocks);
            ts.Button(1, "Reciever Setup")
              .RadioReciever(Channel, Username, Message, name);

            return ts;
        }
コード例 #2
0
        public TronicSequence Subtract(DataNodeIn DataInA, DataNodeIn DataInB, DataNodeOut DataOut, string name = "Subtractor")
        {
            CheckCanAppend();
            FlowTronic NextTronic = tronics.Subtract(name);

            WireArithmeticNode(NextTronic, DataInA, DataInB, DataOut);

            return this;
        }
コード例 #3
0
        private void WireArithmeticNode(FlowTronic next, DataNodeIn DataInA, DataNodeIn DataInB, DataNodeOut DataOut, NodeType NextOut = NodeType.FlowOutA)
        {
            next.DataInA(DataInA);
            next.DataInB(DataInB);
            next.DataOutA(DataOut);

            Append(next, next.GetNode(NextOut));
        }
コード例 #4
0
        public TronicSequence Rand(DataNodeIn DataInA, DataNodeIn DataInB, DataNodeOut DataOut, string name = "Random")
        {
            CheckCanAppend();
            FlowTronic NextTronic = tronics.Rand(name);

            WireArithmeticNode(NextTronic, DataInA, DataInB, DataOut);

            return this;
        }
コード例 #5
0
        public TronicSequence Rotor(DataNodeIn DataInA, DataNodeOut DataOutA, string name = "Rotor")
        {
            CheckCanAppend();

            FlowTronic NextTronic = tronics.Rotor(name);

            NextTronic.DataInA(DataInA);
            NextTronic.DataOutA(DataOutA);

            Append(NextTronic, NextTronic.GetNode(NodeType.FlowOutA));
            return this;
        }
コード例 #6
0
        public TronicSequence RadioReciever(DataNodeIn Channel, DataNodeOut Username, DataNodeOut Message, string name = "Reciever")
        {
            Reciever r = tronics.Reciever(name);
            r.DataInA(Channel);
            r.DataOutB(Username);
            r.DataOutA(Message);
            Append(r, r.GetNode(NodeType.FlowOutA));

            return this;
        }
コード例 #7
0
        public TronicSequence RadioTransmit(DataNodeIn Channel, DataNodeIn Message, string name = "Transmitter")
        {
            CheckCanAppend();

            FlowTronic NextTronic = tronics.Transmitter(name);

            NextTronic.DataInA(Channel);
            NextTronic.DataInB(Message);

            Append(NextTronic, null);

            return this;
        }
コード例 #8
0
        public TronicSequence IfNotEqual(DataNodeIn DataInA, DataNodeIn DataInB, string name = "IfNotEquals", TronicSequence Else = null)
        {
            CheckCanAppend();

            FlowTronic NextTronic = tronics.IfEqual(name);

            NextTronic.DataInA(DataInA);
            NextTronic.DataInB(DataInB);

            if (Else != null)
            {
                NextTronic.FlowOutTo(Else.GetFirst(), NodeType.FlowOutA);
                this.tronics.CopyFromDestructive(Else.tronics);
                this.sequence.AddRange(Else.sequence);
            }

            Append(NextTronic, NextTronic.GetNode(NodeType.FlowOutB));
            NoteBranch(NodeType.FlowOutA);

            return this;
        }
コード例 #9
0
        public TronicSequence Multiply(DataNodeIn DataInA, DataNodeIn DataInB, DataNodeOut DataOut, string name = "Multiplyer")
        {
            CheckCanAppend();
            FlowTronic NextTronic = tronics.Multiply(name);

            WireArithmeticNode(NextTronic, DataInA, DataInB, DataOut);

            return this;
        }
コード例 #10
0
        public TronicSequence Display(DataNodeIn DataInA, string name = "Display", string DefaultText = "")
        {
            CheckCanAppend();
            FlowTronic NextTronic = tronics.Display(name);
            NextTronic.data = DefaultText;

            NextTronic.DataInA(DataInA);

            Append(NextTronic, NextTronic.GetNode(NodeType.FlowOutA));
            return this;
        }
コード例 #11
0
        public TronicSequence Delay(DataNodeIn DataInA = null, string name = "Delay")
        {
            CheckCanAppend();

            FlowTronic NextTronic = tronics.Delay(name);

            NextTronic.DataInA(DataInA);

            Append(NextTronic, NextTronic.GetNode(NodeType.FlowOutA));

            return this;
        }
コード例 #12
0
        public TronicSequence And(DataNodeIn Left, DataNodeIn Right, DataNodeOut DataOut, string name = "And")
        {
            CheckCanAppend();
            FlowTronic NextTronic = tronics.And(name);

            WireArithmeticNode(NextTronic, Left, Right, DataOut);

            return this;
        }
コード例 #13
0
 public DataBlock(int id, string name="Data", string data="", string type="cdata")
     : base(id, type, name, data)
 {
     _in = new DataNodeIn(this);
     _out = new DataNodeOut(this);
 }
コード例 #14
0
        /// <summary>
        /// Wires this tronic's DataInB node to a data block
        /// </summary>
        /// <param name="other">The DataNode to wire to, in In format</param>
        public virtual void DataInB(DataNodeIn other)
        {
            if (other == null)
                return;

            this.WireTo(this.GetNode(NodeType.DataInB), other.Parent.GetNode(NodeType.DataBlock));
        }