12
12
13
13
/**
14
14
* 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.
16
16
* 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.
19
19
* This class, like box2d, is not thread safe.
20
20
*/
21
- public class Box2dWorldMultiThreader implements Disposable {
21
+ public class Box2dWorldTaskSystem implements Disposable {
22
22
23
23
private static final int MAX_TASKS = 128 ;
24
24
@@ -33,21 +33,21 @@ public class Box2dWorldMultiThreader implements Disposable {
33
33
private boolean running = true ;
34
34
35
35
/**
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 }
37
37
*
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.
39
39
*
40
40
* @param worldDef The world to configure
41
41
* @param numWorkers The amount of worker
42
- * @return The created {@link Box2dWorldMultiThreader }
42
+ * @return The created {@link Box2dWorldTaskSystem }
43
43
*/
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 );
46
46
multiThreader .configureForWorld (worldDef );
47
47
return multiThreader ;
48
48
}
49
49
50
- private Box2dWorldMultiThreader (int numWorkers ) {
50
+ private Box2dWorldTaskSystem (int numWorkers ) {
51
51
if (numWorkers <= 1 )
52
52
throw new IllegalArgumentException ("Number of workers must be greater than 1" );
53
53
this .numWorkers = numWorkers ;
0 commit comments