UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

36 lines (26 loc) 815 B
import { GridDataNodePredicate } from "./GridDataNodePredicate.js"; import { assert } from "../../../core/assert.js"; export class GridDataNodePredicateNot extends GridDataNodePredicate { /** * * @type {GridDataNodePredicate} */ source = null; /** * * @param {GridDataNodePredicate} source * @return {GridDataNodePredicateNot} */ static from(source) { assert.equal(source.isGridDataNodePredicate, true, 'source.isGridDataNodePredicate !== true'); const r = new GridDataNodePredicateNot(); r.source = source; return r; } initialize(grid, seed) { this.source.initialize(grid, seed); } evaluate(grid, node) { return !this.source.evaluate(grid, node); } }