Skip to content

Commit 2052e3b

Browse files
committed
chore: Rename to Box2dWorldTaskSystem
1 parent ef50b98 commit 2052e3b

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

gdx-box2d-utils/src/main/java/com/badlogic/gdx/box2d/utils/Box2dWorldMultiThreader.java renamed to gdx-box2d-utils/src/main/java/com/badlogic/gdx/box2d/utils/Box2dWorldTaskSystem.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212

1313
/**
1414
* This class implements a basic TaskSystem in java, for multithreading of a box2d world.
15-
* One {@link Box2dWorldMultiThreader} handles one world.
15+
* One {@link Box2dWorldTaskSystem} handles one world.
1616
* The MultiThreader will create and keep alive the configured amount of workers,
17-
* After every world step, {@link Box2dWorldMultiThreader#afterStep()} needs to be called.
18-
* After the world is destroyed, {@link Box2dWorldMultiThreader#dispose()} needs to be called.
17+
* After every world step, {@link Box2dWorldTaskSystem#afterStep()} needs to be called.
18+
* After the world is destroyed, {@link Box2dWorldTaskSystem#dispose()} needs to be called.
1919
* This class, like box2d, is not thread safe.
2020
*/
21-
public class Box2dWorldMultiThreader implements Disposable {
21+
public class Box2dWorldTaskSystem implements Disposable {
2222

2323
private static final int MAX_TASKS = 128;
2424

@@ -33,21 +33,21 @@ public class Box2dWorldMultiThreader implements Disposable {
3333
private boolean running = true;
3434

3535
/**
36-
* This method creates and configures a {@link b2WorldDef} to use a newly created {@link Box2dWorldMultiThreader}
36+
* This method creates and configures a {@link b2WorldDef} to use a newly created {@link Box2dWorldTaskSystem}
3737
*
38-
* After the world is destroyed, {@link Box2dWorldMultiThreader#dispose()} needs to be called.
38+
* After the world is destroyed, {@link Box2dWorldTaskSystem#dispose()} needs to be called.
3939
*
4040
* @param worldDef The world to configure
4141
* @param numWorkers The amount of worker
42-
* @return The created {@link Box2dWorldMultiThreader}
42+
* @return The created {@link Box2dWorldTaskSystem}
4343
*/
44-
public static Box2dWorldMultiThreader createForWorld(b2WorldDef worldDef, int numWorkers) {
45-
Box2dWorldMultiThreader multiThreader = new Box2dWorldMultiThreader(numWorkers);
44+
public static Box2dWorldTaskSystem createForWorld(b2WorldDef worldDef, int numWorkers) {
45+
Box2dWorldTaskSystem multiThreader = new Box2dWorldTaskSystem(numWorkers);
4646
multiThreader.configureForWorld(worldDef);
4747
return multiThreader;
4848
}
4949

50-
private Box2dWorldMultiThreader(int numWorkers) {
50+
private Box2dWorldTaskSystem(int numWorkers) {
5151
if (numWorkers <= 1)
5252
throw new IllegalArgumentException("Number of workers must be greater than 1");
5353
this.numWorkers = numWorkers;

gdx-box2d-utils/src/test/java/com/badlogic/gdx/box2d/utils/test/Box2dMultiThreaderTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import com.badlogic.gdx.box2d.Box2d;
44
import com.badlogic.gdx.box2d.enums.b2BodyType;
55
import com.badlogic.gdx.box2d.structs.*;
6-
import com.badlogic.gdx.box2d.utils.Box2dWorldMultiThreader;
6+
import com.badlogic.gdx.box2d.utils.Box2dWorldTaskSystem;
77
import org.junit.jupiter.api.Test;
88

99
import static com.badlogic.gdx.box2d.Box2d.*;
@@ -19,9 +19,9 @@ public static void tiltedStacks(int testIndex, int workerCount, b2Vec2[][] final
1919
b2WorldDef worldDef = b2DefaultWorldDef();
2020
worldDef.enableSleep(false);
2121

22-
Box2dWorldMultiThreader multiThreader = null;
22+
Box2dWorldTaskSystem multiThreader = null;
2323
if (workerCount > 1)
24-
multiThreader = Box2dWorldMultiThreader.createForWorld(worldDef, workerCount);
24+
multiThreader = Box2dWorldTaskSystem.createForWorld(worldDef, workerCount);
2525

2626
b2WorldId worldId = b2CreateWorld(worldDef.asPointer());
2727
b2BodyId[] bodies = new b2BodyId[e_count];

0 commit comments

Comments
 (0)