Timeline now passed via constructor
[Mograsim.git] / era.mi / src / era / mi / logic / timeline / Timeline.java
index 07467ea..c22e1a4 100644 (file)
@@ -48,7 +48,7 @@ public class Timeline
         * 
         * @param timestamp  the simulation timestamp up to which the events will be processed
         * @param stopMillis the System.currentTimeMillis() when simulation definitely needs to stop. A value of -1 means no timeout.
-        * @return if it was possible to fulfil the goal in the given real world time.
+        * @return if it was possible to fulfill the goal in the given real world time.
         * @author Christian Femers
         */
        public ExecutionResult executeUpTo(long timestamp, long stopMillis)
@@ -117,7 +117,7 @@ public class Timeline
                eventAddedListener.forEach(l -> l.accept(event));
        }
 
-       private class InnerEvent implements Comparable<InnerEvent>
+       private class InnerEvent implements Runnable, Comparable<InnerEvent>
        {
                private final TimelineEventHandler function;
                private final TimelineEvent event;
@@ -139,6 +139,7 @@ public class Timeline
                        return event.getTiming();
                }
 
+               @Override
                public void run()
                {
                        function.handle(event);