@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
45 lines (33 loc) • 742 B
JavaScript
import { computeStringHash } from "../../../core/primitives/strings/computeStringHash.js";
export class TooltipComponent {
/**
*
* @type {string}
*/
key = '';
hash() {
return computeStringHash(this.key);
}
/**
*
* @param {TooltipComponent} other
* @return {boolean}
*/
equals(other) {
return this.key === other.key;
}
toJSON() {
return {
key: this.key
};
}
fromJSON({ key }) {
this.key = key;
}
static fromJSON(json) {
const r = new TooltipComponent();
r.fromJSON(json);
return r;
}
}
TooltipComponent.typeName = 'Tooltip';