import java.util.ArrayList;\r
import java.util.List;\r
\r
-import era.mi.logic.Simulation;\r
+import era.mi.logic.timeline.Timeline;\r
import era.mi.logic.types.Bit;\r
import era.mi.logic.types.BitVector;\r
import era.mi.logic.types.BitVector.BitVectorMutator;\r
private List<ReadEnd> attached = new ArrayList<ReadEnd>();\r
public final int length;\r
private List<ReadWriteEnd> inputs = new ArrayList<ReadWriteEnd>();\r
+ private Timeline timeline;\r
\r
- public Wire(int length, int travelTime)\r
+ public Wire(Timeline timeline, int length, int travelTime)\r
{\r
if (length < 1)\r
throw new IllegalArgumentException(\r
String.format("Tried to create an array of wires with length %d, but a length of less than 1 makes no sense.", length));\r
+ this.timeline = timeline;\r
this.length = length;\r
this.travelTime = travelTime;\r
initValues();\r
String.format("Attempted to input %d bits instead of %d bits.", newValues.length(), length));\r
if (!open)\r
throw new RuntimeException("Attempted to write to closed WireArrayEnd.");\r
- Simulation.TIMELINE.addEvent(e -> setValues(newValues), travelTime);\r
+ timeline.addEvent(e -> setValues(newValues), travelTime);\r
}\r
\r
/**\r
{\r
if (!open)\r
throw new RuntimeException("Attempted to write to closed WireArrayEnd.");\r
- Simulation.TIMELINE.addEvent(e -> setValues(startingBit, bitVector), travelTime);\r
+ timeline.addEvent(e -> setValues(startingBit, bitVector), travelTime);\r
}\r
\r
private void setValues(int startingBit, BitVector newValues)\r