import { Cosmic, Entity, System } from "@cosmic/core"; import { Name } from "@cosmic/kit/components"; export class LoggingSystem extends System { private worldStore: Map; constructor(engine: Cosmic) { super(); this.worldStore = engine.getStore("cosmic.world"); } public readonly requiredComponents = new Set([Name.name]); public update(entities: Entity[], _deltaTime: number) { for (const entity of entities) { console.log(` ==================== Entity ==================== ID: ${entity.id} Name: '${entity.getComponent(Name)?.name}' Description: '${entity.getComponent(Name)?.description}' =============== World Properties =============== Gravitational Strength: ${this.worldStore.get("cosmic.world.gravity.strength") ?? 0} Cell Size: ${this.worldStore.get("cosmic.world.grid.cellSize") ?? 0} `); } } }