diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-03-01 18:56:58 -0700 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-03-01 18:56:58 -0700 |
commit | a8d07a790395e14fe7aedd3ba638db466f9c0842 (patch) | |
tree | 644f60a6bca79ceb55f24fcab7bdb3dee52c2d6e /src/engine/entities/Entity.ts | |
parent | aa08a8943a9a2d4a0e51893eebe6900bca7a7251 (diff) | |
download | the-abstraction-engine-a8d07a790395e14fe7aedd3ba638db466f9c0842.tar.gz the-abstraction-engine-a8d07a790395e14fe7aedd3ba638db466f9c0842.zip |
boundingbox + draw player
Diffstat (limited to 'src/engine/entities/Entity.ts')
-rw-r--r-- | src/engine/entities/Entity.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/engine/entities/Entity.ts b/src/engine/entities/Entity.ts index 18ee5d0..2cc2ac3 100644 --- a/src/engine/entities/Entity.ts +++ b/src/engine/entities/Entity.ts @@ -1,13 +1,13 @@ import { type Component } from "../components"; -const randomId = () => (Math.random() * 1_000_000_000).toString(); - export abstract class Entity { + static Id = 0; + public id: string; public components: Map<string, Component>; public name: string; - constructor(name: string, id: string = randomId()) { + constructor(name: string, id: string = (Entity.Id++).toString()) { this.name = name; this.id = id; this.components = new Map(); |