avocado-old/packages/entity/trait/registry.js
2019-04-25 23:11:05 -05:00

14 lines
260 B
JavaScript

const traitRegistry = new Map();
export function registerTrait(Trait) {
traitRegistry.set(Trait.type(), Trait);
}
export function hasTrait(type) {
return traitRegistry.has(type);
}
export function lookupTrait(type) {
return traitRegistry.get(type);
}