forked from junkdog/artemis-odb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
66 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
artemis/src/test/java/com/artemis/systems/IntervalEntitySystemTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.artemis.systems; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
import org.junit.Test; | ||
|
||
import com.artemis.Aspect; | ||
import com.artemis.Entity; | ||
import com.artemis.World; | ||
import com.artemis.component.ComponentX; | ||
import com.artemis.utils.ImmutableBag; | ||
|
||
@SuppressWarnings("static-method") | ||
public class IntervalEntitySystemTest { | ||
|
||
private static final float ACC = 0.0001f; | ||
|
||
@Test | ||
public void test_interval_delta() { | ||
|
||
World world = new World(); | ||
IntervalSystem es = world.setSystem(new IntervalSystem()); | ||
world.initialize(); | ||
|
||
world.delta = 1.1f; | ||
world.process(); | ||
assertEquals(1.1, es.getIntervalDelta(), ACC); | ||
|
||
world.delta = 0.95f; | ||
world.process(); | ||
assertEquals(0.95, es.getIntervalDelta(), ACC); | ||
} | ||
|
||
private static class IntervalSystem extends IntervalEntitySystem { | ||
|
||
@SuppressWarnings("unchecked") | ||
public IntervalSystem() { | ||
super(Aspect.getAspectForAll(ComponentX.class), 1); | ||
} | ||
|
||
@Override | ||
protected void processEntities(ImmutableBag<Entity> entities) { | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters