import {Trait} from "../Entity.js"; export default class Collider extends Trait { constructor(entity) { super(entity, "collider"); this.collides = false; this.cEntity = null; this.cStructure = null; this.cBounds = null; } collideEntity(e) { this.collides = true; this.cEntity = e; this.cBounds = e.bounds; } collideStructure(s, b) { this.collides = true; this.cStructure = s; this.cBounds = b; } postUpdate() { this.cEntity = null; this.cStructure = null; this.collides = false; } }