11package com .github .elebras1 .flecs ;
22
3- import com .github .elebras1 .flecs .collection .EcsLongList ;
3+ import com .github .elebras1 .flecs .collection .LongList ;
44import com .github .elebras1 .flecs .util .FlecsConstants ;
55import com .github .elebras1 .flecs .util .internal .FlecsLoader ;
66
77import java .lang .foreign .*;
88import java .nio .charset .StandardCharsets ;
9+ import java .util .HashMap ;
910import java .util .Map ;
10- import java .util .concurrent .ConcurrentHashMap ;
1111import java .util .function .Consumer ;
1212
1313import static java .lang .foreign .ValueLayout .*;
@@ -143,8 +143,8 @@ public World() {
143143 }
144144
145145 this .componentRegistry = new ComponentRegistry (this );
146- this .systemCallbacks = new ConcurrentHashMap <>();
147- this .observerCallbacks = new ConcurrentHashMap <>();
146+ this .systemCallbacks = new HashMap <>();
147+ this .observerCallbacks = new HashMap <>();
148148 this .defaultBuffers = new FlecsBuffers ();
149149 this .closed = false ;
150150 this .owned = true ;
@@ -154,8 +154,8 @@ private World(MemorySegment stagePtr, ComponentRegistry sharedRegistry) {
154154 this .arena = Arena .ofConfined ();
155155 this .nativeWorld = stagePtr ;
156156 this .componentRegistry = sharedRegistry ;
157- this .systemCallbacks = new ConcurrentHashMap <>();
158- this .observerCallbacks = new ConcurrentHashMap <>();
157+ this .systemCallbacks = new HashMap <>();
158+ this .observerCallbacks = new HashMap <>();
159159 this .defaultBuffers = null ;
160160 this .closed = false ;
161161 this .owned = false ;
@@ -188,7 +188,7 @@ MemorySegment getComponentBuffer(long size) {
188188 return this .defaultBuffers .componentBuffer ().ensure (size );
189189 }
190190
191- public EcsLongList entityBulk (int count ) {
191+ public LongList entityBulk (int count ) {
192192 this .checkClosed ();
193193 try (Arena tempArena = Arena .ofConfined ()) {
194194 MemorySegment desc = ecs_bulk_desc_t .allocate (tempArena );
@@ -197,13 +197,13 @@ public EcsLongList entityBulk(int count) {
197197
198198 MemorySegment idsSegment = flecs_h .ecs_bulk_init (this .nativeWorld , desc );
199199
200- EcsLongList ids = new EcsLongList (count );
200+ LongList ids = new LongList (count );
201201 ids .addAll (idsSegment .asSlice (0 , (long ) count * Long .BYTES ).toArray (JAVA_LONG ));
202202 return ids ;
203203 }
204204 }
205205
206- public final EcsLongList entityBulk (int count , Class <?>... componentClasses ) {
206+ public final LongList entityBulk (int count , Class <?>... componentClasses ) {
207207 this .checkClosed ();
208208
209209 if (count <= 0 ) {
@@ -244,7 +244,7 @@ public final EcsLongList entityBulk(int count, Class<?>... componentClasses) {
244244
245245 MemorySegment entitiesPtr = flecs_h .ecs_bulk_init (this .nativeWorld , desc );
246246
247- EcsLongList entities = new EcsLongList (count );
247+ LongList entities = new LongList (count );
248248 entities .addAll (entitiesPtr .asSlice (0 , (long ) count * Long .BYTES ).toArray (JAVA_LONG ));
249249
250250 return entities ;
@@ -408,14 +408,14 @@ public long getMaxId() {
408408 return flecs_h .ecs_get_max_id (this .nativeWorld );
409409 }
410410
411- public EcsLongList getEntities () {
411+ public LongList getEntities () {
412412 this .checkClosed ();
413413 try (Arena tempArena = Arena .ofConfined ()) {
414414 MemorySegment entitiesStruct = flecs_h .ecs_get_entities (tempArena , this .nativeWorld );
415415 MemorySegment idsPointer = entitiesStruct .get (ValueLayout .ADDRESS , 0 );
416416 int count = entitiesStruct .get (ValueLayout .JAVA_INT , ValueLayout .ADDRESS .byteSize ());
417417
418- EcsLongList entities = new EcsLongList (count );
418+ LongList entities = new LongList (count );
419419 if (count > 0 && !idsPointer .equals (MemorySegment .NULL )) {
420420 MemorySegment idsArray = idsPointer .reinterpret ((long ) count * Long .BYTES );
421421 entities .addAll (idsArray .toArray (ValueLayout .JAVA_LONG ));
0 commit comments