added some convenience methods that make our lives easier
[Mograsim.git] / era.mi / src / era / mi / logic / timeline / Timeline.java
index bdd5947..2392f4c 100644 (file)
@@ -15,7 +15,6 @@ public class Timeline
        public Timeline(int initCapacity)
        {
                events = new PriorityQueue<InnerEvent>(initCapacity, (a, b) -> {
-                       //Is this really necessary? If only ints are allowed as relative timing, the difference should always be an int
                        long difference = a.getTiming() - b.getTiming();
                        if(difference == 0)
                                return 0;
@@ -34,6 +33,12 @@ public class Timeline
                currentTime = first.getTiming();
                first.run();
        }
+       
+       public void executeAll()
+       {
+               while (hasNext())
+                       executeNext();
+       }
 
        public long getSimulationTime()
        {