import { Entity } from "./entity" ; import IEntityBuilder from "./entity-builder.spec" ; import { TObjectProto } from "./_.spec" ; export * from './entity-builder.spec' ; export class EntityBuilder implements IEntityBuilder { protected entity : Entity ; constructor ( uuid ? , protected callback ? ) { this . entity = new Entity ( uuid ) ; } build ( ) { this . callback ?. ( this . entity ) ; return this . entity ; } with ( component , ... args ) { this . entity . addComponent ( component ) ; return this ; } withAll ( ... components ) { let component ; for ( component of components ) { this . with ( component ) ; } return this ; } }