projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added some convenience methods that make our lives easier
[Mograsim.git]
/
era.mi
/
src
/
era
/
mi
/
logic
/
timeline
/
Timeline.java
diff --git
a/era.mi/src/era/mi/logic/timeline/Timeline.java
b/era.mi/src/era/mi/logic/timeline/Timeline.java
index
bdd5947
..
2392f4c
100644
(file)
--- a/
era.mi/src/era/mi/logic/timeline/Timeline.java
+++ b/
era.mi/src/era/mi/logic/timeline/Timeline.java
@@
-15,7
+15,6
@@
public class Timeline
public Timeline(int initCapacity)
{
events = new PriorityQueue<InnerEvent>(initCapacity, (a, b) -> {
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;
long difference = a.getTiming() - b.getTiming();
if(difference == 0)
return 0;
@@
-34,6
+33,12
@@
public class Timeline
currentTime = first.getTiming();
first.run();
}
currentTime = first.getTiming();
first.run();
}
+
+ public void executeAll()
+ {
+ while (hasNext())
+ executeNext();
+ }
public long getSimulationTime()
{
public long getSimulationTime()
{