2d-physics-engine
Version:
A lightweight, flexible 2D physics engine with ECS architecture, built with TypeScript
20 lines • 704 B
TypeScript
import { Component } from '../components/Component.abstract';
export declare class Entity {
readonly name: string;
private components;
private children;
private active;
parent: Entity | null;
constructor(name?: string);
addComponent<T extends Component>(component: T): T;
getComponent<T extends Component>(componentType: abstract new (...args: any[]) => T): T | undefined;
removeComponent(componentType: {
new (...args: any[]): Component;
}): void;
addChild(child: Entity): void;
removeChild(child: Entity): void;
setActive(active: boolean): void;
update(deltaTime: number): void;
destroy(): void;
}
//# sourceMappingURL=Entity.d.ts.map