UNPKG

@woosh/meep-engine

Version:

Pure JavaScript game engine. Fully featured and production ready.

60 lines (53 loc) 952 B
export class Voice { /** * * @type {number} */ flags = 0; /** * * @param {number|VoiceFlags} flag * @returns {void} */ setFlag(flag) { this.flags |= flag; } /** * * @param {number|VoiceFlags} flag * @returns {void} */ clearFlag(flag) { this.flags &= ~flag; } /** * * @param {number|VoiceFlags} flag * @param {boolean} value */ writeFlag(flag, value) { if (value) { this.setFlag(flag); } else { this.clearFlag(flag); } } /** * * @param {number|VoiceFlags} flag * @returns {boolean} */ getFlag(flag) { return (this.flags & flag) === flag; } } /** * * @type {boolean} */ Voice.serializable = false; /** * @readonly * @type {string} */ Voice.typeName = 'Voice';