@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
40 lines (34 loc) • 727 B
JavaScript
/**
* Base abstract class for any managed resource such as a texture of a buffer
*/
export class ResourceDescriptor {
/**
* Resource type, useful for debugging and UI
* Not guaranteed to be unique
* @return {string}
*/
get type() {
return 'resource'
}
/**
* For fast type checks
* @return {boolean}
*/
get isResourceDescriptor() {
return true;
}
hash() {
return 0;
}
/**
* @template T {ResourceDescriptor}
* @param {T} other
* @returns {boolean}
*/
equals(other) {
return this.type === other.type;
}
toString(){
return this.type;
}
}