@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
44 lines (38 loc) • 973 B
JavaScript
import { combine_hash } from "../../../../../core/collection/array/combine_hash.js";
import { computeHashFloat } from "../../../../../core/primitives/numbers/computeHashFloat.js";
export class AnimationNotification {
constructor() {
/**
*
* @type {AnimationNotificationDefinition}
*/
this.def = null;
/**
* When the notification is to be sent
* @type {number}
*/
this.time = 0;
}
/**
*
* @param {AnimationNotification} other
* @returns {boolean}
*/
equals(other) {
if (this === other) {
return true;
}
return this.time === other.time
&& this.def.equals(other.def)
;
}
/**
* @returns {number}
*/
hash() {
return combine_hash(
computeHashFloat(this.time),
this.def.hash()
);
}
}