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; }
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; }
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)); }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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); }
/// <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)); }