Exemple #1
0
 /// <summary>
 /// Adds a new connecting wire to the chip
 /// </summary>
 /// <param name="id">Id of circuit to use as start of wire</param>
 protected void AddWire(Guid id, Wire wire)
 {
     if (!WireDict.ContainsKey(id))
     {
         WireDict.Add(id, new List <Wire>());
     }
     WireDict[id].Add(wire);
 }
Exemple #2
0
 protected int AddChip(Chip chip)
 {
     Chips.Add(chip);
     if (!WireDict.ContainsKey(chip.ID))
     {
         WireDict.Add(chip.ID, new List <Wire>());
     }
     return(Chips.Count - 1);
 }
Exemple #3
0
 protected int AddGate(Gate gate)
 {
     Gates.Add(gate);
     if (!WireDict.ContainsKey(gate.ID))
     {
         WireDict.Add(gate.ID, new List <Wire>());
     }
     return(Gates.Count - 1);
 }
Exemple #4
0
 protected Chip AddChipIndexed(Chip chip)
 {
     Chips.Add(chip);
     if (!WireDict.ContainsKey(chip.ID))
     {
         WireDict.Add(chip.ID, new List <Wire>());
     }
     chip.index = Chips.Count - 1;
     return(chip);
 }
Exemple #5
0
 protected Gate AddGateIndexed(Gate gate)
 {
     Gates.Add(gate);
     if (!WireDict.ContainsKey(gate.ID))
     {
         WireDict.Add(gate.ID, new List <Wire>());
     }
     gate.index = Gates.Count - 1;
     return(gate);
 }