X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.core%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fcore%2Fcomponents%2FBasicComponent.java;fp=net.mograsim.logic.core%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fcore%2Fcomponents%2FBasicComponent.java;h=0000000000000000000000000000000000000000;hb=0a04a4ed66ecebd4254541c4977599f6052c115a;hp=56dc68755e90f9765472dadd3506b6da45d3c5bc;hpb=9b4850366c29fbd800ee8df1858c398d8c35a0c0;p=Mograsim.git diff --git a/net.mograsim.logic.core/src/net/mograsim/logic/core/components/BasicComponent.java b/net.mograsim.logic.core/src/net/mograsim/logic/core/components/BasicComponent.java deleted file mode 100644 index 56dc6875..00000000 --- a/net.mograsim.logic.core/src/net/mograsim/logic/core/components/BasicComponent.java +++ /dev/null @@ -1,35 +0,0 @@ -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; - -/** - * A basic component that recomputes all outputs (with a delay), when it is updated. - * - * @author Fabian Stemmler - */ -public abstract class BasicComponent extends Component implements LogicObserver -{ - private int processTime; - - /** - * - * @param processTime Amount of time this component takes to update its outputs. Must be more than 0, otherwise 1 is assumed. - * - * @author Fabian Stemmler - */ - public BasicComponent(Timeline timeline, int processTime) - { - super(timeline); - this.processTime = processTime > 0 ? processTime : 1; - } - - @Override - public void update(LogicObservable initiator) - { - timeline.addEvent(e -> compute(), processTime); - } - - protected abstract void compute(); -}