projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CoreComponents now have a transport delay
[Mograsim.git]
/
net.mograsim.logic.core
/
src
/
net
/
mograsim
/
logic
/
core
/
components
/
BasicCoreComponent.java
diff --git
a/net.mograsim.logic.core/src/net/mograsim/logic/core/components/BasicCoreComponent.java
b/net.mograsim.logic.core/src/net/mograsim/logic/core/components/BasicCoreComponent.java
index
9f3da4a
..
369a05f
100644
(file)
--- a/
net.mograsim.logic.core/src/net/mograsim/logic/core/components/BasicCoreComponent.java
+++ b/
net.mograsim.logic.core/src/net/mograsim/logic/core/components/BasicCoreComponent.java
@@
-3,6
+3,7
@@
package net.mograsim.logic.core.components;
import net.mograsim.logic.core.LogicObservable;
import net.mograsim.logic.core.LogicObserver;
import net.mograsim.logic.core.timeline.Timeline;
import net.mograsim.logic.core.LogicObservable;
import net.mograsim.logic.core.LogicObserver;
import net.mograsim.logic.core.timeline.Timeline;
+import net.mograsim.logic.core.timeline.TimelineEventHandler;
/**
* A basic component that recomputes all outputs (with a delay), when it is updated.
/**
* A basic component that recomputes all outputs (with a delay), when it is updated.
@@
-26,10
+27,12
@@
public abstract class BasicCoreComponent extends CoreComponent implements LogicO
}
@Override
}
@Override
- public void update(LogicObservable initiator)
+ public
final
void update(LogicObservable initiator)
{
{
- timeline.addEvent(e -> compute(), processTime);
+ TimelineEventHandler delayedUpdates = compute();
+ if (delayedUpdates != null)
+ timeline.addEvent(delayedUpdates, processTime);
}
}
- protected abstract
void
compute();
+ protected abstract
TimelineEventHandler
compute();
}
}