UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

51 lines (42 loc) 1.09 kB
import { assert } from "../../core/assert.js"; export class VisualTip { /** * * @param {Rectangle} target * @param {function} tipFactory * @param {*} [factoryContext] * @param {Rectangle[]} [obstacles] */ constructor(target, tipFactory, factoryContext, obstacles = []) { assert.defined(target, 'target'); assert.notNull(target, 'target'); assert.isFunction(tipFactory, 'tipFactory') assert.defined(obstacles, 'obstacles'); assert.isArray(obstacles, 'obstacles'); /** * * @type {Rectangle} */ this.target = target; /** * * @type {Function} */ this.factory = tipFactory; /** * * @type {*} */ this.factoryContext = factoryContext; /** * * @type {Rectangle[]} */ this.obstracles = obstacles; /** * * @type {View|null} */ this.view = null; } }