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/entities | |
parent | 2dc3120831fbcd03b635bbad59213ff0bf1f8879 (diff) | |
download | jumpstorm-732fe6f4811cc082bf938fed2d28c1f9c8bbd1f6.tar.gz jumpstorm-732fe6f4811cc082bf938fed2d28c1f9c8bbd1f6.zip |
generate uuids for entities; scaffolding for a server
Diffstat (limited to 'engine/entities')
-rw-r--r-- | engine/entities/Entity.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/engine/entities/Entity.ts b/engine/entities/Entity.ts index ca8d314..b2d875d 100644 --- a/engine/entities/Entity.ts +++ b/engine/entities/Entity.ts @@ -1,13 +1,11 @@ import type { Component } from "../components"; export abstract class Entity { - private static ID = 0; - - public readonly id: number; + public readonly id: string; public readonly components: Map<string, Component>; constructor() { - this.id = Entity.ID++; + this.id = crypto.randomUUID(); this.components = new Map(); } |