silphius/app/react/components/client-ecs.js
2024-09-21 06:24:26 -05:00

23 lines
513 B
JavaScript

import Ecs from '@/ecs/ecs.js';
import {readAsset} from '@/util/resources.js';
export default class ClientEcs extends Ecs {
constructor(specification) {
super(specification);
[
'MaintainColliderHash',
].forEach((defaultSystem) => {
const System = this.system(defaultSystem);
if (System) {
System.active = true;
}
});
}
async readAsset(path) {
const resource = await readAsset(path);
return resource
? resource
: new ArrayBuffer(0);
}
}