12 lines
413 B
TypeScript
12 lines
413 B
TypeScript
import type { IGameObject } from "../interfaces/generic";
|
|
|
|
export abstract class GameObject implements IGameObject {
|
|
static readonly instances = new Map<string, GameObject>()
|
|
readonly uuid: string;
|
|
readonly socket: WebSocket
|
|
constructor(socket: WebSocket, { uuid }: { uuid: string }) {
|
|
this.uuid = uuid
|
|
this.socket = socket
|
|
GameObject.instances.set(this.uuid, this)
|
|
}
|
|
} |