summaryrefslogtreecommitdiff
path: root/src/engine/entities/Entity.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/entities/Entity.ts')
-rw-r--r--src/engine/entities/Entity.ts6
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();