Commits

Michael Ludwig committed 3c41bfa

Make the timing tasks parallel aware.

  • Participants
  • Parent commits 9ccdcfc

Comments (0)

Files changed (1)

src/main/java/com/lhkbob/entreri/task/Timers.java

 package com.lhkbob.entreri.task;
 
+import java.util.Collections;
+import java.util.Set;
+
+import com.lhkbob.entreri.ComponentData;
 import com.lhkbob.entreri.EntitySystem;
 
 public final class Timers {
         return new MeasuredDeltaTask();
     }
 
-    private static class FixedDeltaTask implements Task {
+    private static class FixedDeltaTask implements Task, ParallelAware {
         private final ElapsedTimeResult delta;
 
         public FixedDeltaTask(double dt) {
         public void reset(EntitySystem system) {
             // do nothing
         }
+
+        @Override
+        public Set<Class<? extends ComponentData<?>>> getAccessedComponents() {
+            return Collections.emptySet();
+        }
+
+        @Override
+        public boolean isEntitySetModified() {
+            return false;
+        }
     }
 
-    private static class MeasuredDeltaTask implements Task {
+    private static class MeasuredDeltaTask implements Task, ParallelAware {
         private long lastStart = -1L;
 
         @Override
         public void reset(EntitySystem system) {
             // do nothing
         }
+
+        @Override
+        public Set<Class<? extends ComponentData<?>>> getAccessedComponents() {
+            return Collections.emptySet();
+        }
+
+        @Override
+        public boolean isEntitySetModified() {
+            return false;
+        }
     }
 }