@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
39 lines (29 loc) • 758 B
JavaScript
import { assert } from "../../../../core/assert.js";
import { Behavior } from "../Behavior.js";
/**
*
* @author Alex Goldring
* @copyright Company Named Limited (c) 2025
*/
export class EntityBehavior extends Behavior {
/**
* Entity ID
* @type {number}
*/
entity = -1;
/**
*
* @type {EntityComponentDataset}
*/
ecd = null;
initialize(context) {
const {entity, ecd, engine} = context;
assert.isNumber(entity, 'entity');
assert.defined(ecd);
assert.defined(engine);
assert.ok(engine.isEngine, 'engine.isEngine !== true');
super.initialize(context);
this.entity = entity;
this.ecd = ecd;
}
}