@@ -2,7 +2,7 @@ import { describe, expect, it } from "bun:test";
22import type { ComponentId , EntityId } from "./entity" ;
33import {
44 COMPONENT_ID_MAX ,
5- ComponentIdManager ,
5+ ComponentIdAllocator ,
66 createComponentId ,
77 createEntityId ,
88 relation ,
@@ -373,22 +373,22 @@ describe("EntityIdManager", () => {
373373describe ( "ComponentIdManager" , ( ) => {
374374 describe ( "Allocation" , ( ) => {
375375 it ( "should allocate sequential component IDs starting from 1" , ( ) => {
376- const manager = new ComponentIdManager ( ) ;
376+ const manager = new ComponentIdAllocator ( ) ;
377377 expect ( manager . allocate ( ) ) . toBe ( createComponentId ( 1 ) ) ;
378378 expect ( manager . allocate ( ) ) . toBe ( createComponentId ( 2 ) ) ;
379379 expect ( manager . allocate ( ) ) . toBe ( createComponentId ( 3 ) ) ;
380380 } ) ;
381381
382382 it ( "should allocate up to COMPONENT_ID_MAX" , ( ) => {
383- const manager = new ComponentIdManager ( ) ;
383+ const manager = new ComponentIdAllocator ( ) ;
384384 for ( let i = 1 ; i <= COMPONENT_ID_MAX ; i ++ ) {
385385 expect ( manager . allocate ( ) ) . toBe ( createComponentId ( i ) ) ;
386386 }
387387 expect ( manager . hasAvailableIds ( ) ) . toBe ( false ) ;
388388 } ) ;
389389
390390 it ( "should throw error when exceeding maximum component IDs" , ( ) => {
391- const manager = new ComponentIdManager ( ) ;
391+ const manager = new ComponentIdAllocator ( ) ;
392392 // Allocate all available IDs
393393 for ( let i = 1 ; i <= COMPONENT_ID_MAX ; i ++ ) {
394394 manager . allocate ( ) ;
@@ -399,7 +399,7 @@ describe("ComponentIdManager", () => {
399399
400400 describe ( "State Queries" , ( ) => {
401401 it ( "should report correct next ID" , ( ) => {
402- const manager = new ComponentIdManager ( ) ;
402+ const manager = new ComponentIdAllocator ( ) ;
403403 expect ( manager . getNextId ( ) ) . toBe ( 1 ) ;
404404 manager . allocate ( ) ;
405405 expect ( manager . getNextId ( ) ) . toBe ( 2 ) ;
@@ -408,7 +408,7 @@ describe("ComponentIdManager", () => {
408408 } ) ;
409409
410410 it ( "should correctly report available IDs" , ( ) => {
411- const manager = new ComponentIdManager ( ) ;
411+ const manager = new ComponentIdAllocator ( ) ;
412412 expect ( manager . hasAvailableIds ( ) ) . toBe ( true ) ;
413413
414414 // Allocate all but one
0 commit comments