Skip to content

Commit f7943e2

Browse files
committed
feat(entity): add global component ID allocation function
Added a new function `component` to allocate a new component ID from the global component ID allocator. This enhances the ID management capabilities within the entity system.
1 parent 0898d91 commit f7943e2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/entity.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,10 @@ export class ComponentIdAllocator {
398398
}
399399

400400
const globalComponentIdAllocator = new ComponentIdAllocator();
401+
402+
/**
403+
* Allocate a new component ID from the global allocator
404+
*/
401405
export function component<T>(): ComponentId<T> {
402406
return globalComponentIdAllocator.allocate<T>();
403407
}

0 commit comments

Comments
 (0)