UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

22 lines (19 loc) 580 B
import { resolvePathByArray } from "../../../../core/json/resolvePathByArray.js"; import { BoundValueWriter } from "./BoundValueWriter.js"; export class BoundPlainNumericPropertyWriter extends BoundValueWriter { /** * @type {Object} */ parent; /** * @type {string} */ property_name; bind(root, path) { this.parent = resolvePathByArray(root, path.slice(0, path.length - 1)); this.property_name = path[path.length - 1]; } write(data) { this.parent[this.property_name] = data[0]; } }