diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-08-15 18:30:19 -0600 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-08-15 18:30:19 -0600 |
commit | 732fe6f4811cc082bf938fed2d28c1f9c8bbd1f6 (patch) | |
tree | bf9d2aa160fb3e5564f4ae788ecc86927b716e0b /engine/Game.ts | |
parent | 2dc3120831fbcd03b635bbad59213ff0bf1f8879 (diff) | |
download | jumpstorm-732fe6f4811cc082bf938fed2d28c1f9c8bbd1f6.tar.gz jumpstorm-732fe6f4811cc082bf938fed2d28c1f9c8bbd1f6.zip |
generate uuids for entities; scaffolding for a server
Diffstat (limited to 'engine/Game.ts')
-rw-r--r-- | engine/Game.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/engine/Game.ts b/engine/Game.ts index 07d06e8..8dc5db7 100644 --- a/engine/Game.ts +++ b/engine/Game.ts @@ -7,9 +7,9 @@ export class Game { private running: boolean; private lastTimeStamp: number; - public entities: Map<number, Entity>; + public entities: Map<string, Entity>; public systems: Map<string, System>; - public componentEntities: Map<string, Set<number>>; + public componentEntities: Map<string, Set<string>>; constructor() { this.lastTimeStamp = performance.now(); @@ -29,11 +29,11 @@ export class Game { this.entities.set(entity.id, entity); } - public getEntity(id: number): Entity | undefined { + public getEntity(id: string): Entity | undefined { return this.entities.get(id); } - public removeEntity(id: number) { + public removeEntity(id: string) { this.entities.delete(id); } @@ -75,7 +75,7 @@ export class Game { if (!this.componentEntities.has(component.name)) { this.componentEntities.set( component.name, - new Set<number>([entity.id]), + new Set<string>([entity.id]), ); return; } |