silphius/app/server/create/ecs.js

34 lines
753 B
JavaScript
Raw Normal View History

2024-07-20 05:07:39 -05:00
import Components from '@/ecs/components/index.js';
import Systems from '@/ecs/systems/index.js';
2024-07-02 20:43:55 -05:00
export default function createEcs(Ecs) {
const ecs = new Ecs({Components, Systems});
const defaultSystems = [
2024-07-21 11:14:51 -05:00
'Behave',
2024-07-04 15:17:33 -05:00
'PassTime',
2024-07-03 19:05:40 -05:00
'Attract',
2024-07-02 20:43:55 -05:00
'ResetForces',
'ApplyControlMovement',
'IntegratePhysics',
'ClampPositions',
'PlantGrowth',
'FollowCamera',
'VisibleAabbs',
2024-07-28 18:40:58 -05:00
'MaintainColliderHash',
2024-07-02 22:42:56 -05:00
'Colliders',
2024-07-02 20:43:55 -05:00
'ControlDirection',
'SpriteDirection',
'RunAnimations',
'RunTickingPromises',
'Water',
'Interactions',
];
defaultSystems.forEach((defaultSystem) => {
const System = ecs.system(defaultSystem);
if (System) {
System.active = true;
}
});
return ecs;
}