Exemplo n.º 1
0
        public Unit.Renderer CreateEmbryo()
        {
            var src0   = new Unit.TableSource(freqTable);
            var src1   = new Unit.TableSource(powerTable);
            var stub   = new Unit.Multiplier();
            var render = new Unit.Renderer();

            Unit.UnitBase.Connect(src0, 0, stub, 0);
            Unit.UnitBase.Connect(src1, 0, stub, 1);
            Unit.UnitBase.Connect(stub, 0, render, 0);
            firstPoint = stub;

            return(render);
        }
Exemplo n.º 2
0
 /// <summary>
 /// oldのInputの指定ノードをnextのInputの指定ノードに繋ぎ変え、oldのInputの指定ノードを新たにnewInputのOutputの指定ノードにつなぐ
 /// </summary>
 /// <param name="old"></param>
 /// <param name="oldIndex"></param>
 /// <param name="next"></param>
 /// <param name="nextIndex"></param>
 /// <param name="newInput"></param>
 /// <param name="newInputIndex"></param>
 public static void ReplaceInput(UnitBase old, int oldIndex, UnitBase next, int nextIndex, UnitBase newInput, int newInputIndex)
 {
     next.In[nextIndex]        = old.In[oldIndex];
     next.In[nextIndex].ToUnit = next;
     Connect(newInput, newInputIndex, old, oldIndex);
 }
Exemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="old"></param>
 /// <param name="oldIndex">Oldの出力index</param>
 /// <param name="next"></param>
 /// <param name="nextIndex"></param>
 /// <param name="newOutput"></param>
 /// <param name="newOutputIndex">Old出力を新たにつなぐ先のnewの入力index</param>
 public static void ReplaceOutput(UnitBase old, int oldIndex, UnitBase next, int nextIndex, UnitBase newOutput, int newOutputIndex)
 {
     next.Out[nextIndex]          = old.Out[oldIndex];
     next.Out[nextIndex].FromUnit = next;
     Connect(old, oldIndex, newOutput, newOutputIndex);
 }
Exemplo n.º 4
0
 public Connection(UnitBase from, UnitBase to)
 {
     FromUnit = from;
     ToUnit   = to;
 }