diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-03-07 22:55:41 -0700 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2024-03-07 22:55:41 -0700 |
commit | ea6c1eef48ba8d39defdd8cd78adc45ae660caf9 (patch) | |
tree | 1ec594f68ea7925b9e10c267ac221e1daf4d1bc6 /src/engine/systems | |
parent | ebae24f5a3a251654a1e41be58f52ba2a777d9d7 (diff) | |
download | the-abstraction-engine-ea6c1eef48ba8d39defdd8cd78adc45ae660caf9.tar.gz the-abstraction-engine-ea6c1eef48ba8d39defdd8cd78adc45ae660caf9.zip |
fuck
Diffstat (limited to 'src/engine/systems')
-rw-r--r-- | src/engine/systems/Spawner.ts | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/engine/systems/Spawner.ts b/src/engine/systems/Spawner.ts deleted file mode 100644 index 6a4d382..0000000 --- a/src/engine/systems/Spawner.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { System, SystemNames } from "."; -import { Game } from ".."; -import { ComponentNames, Grid, GridSpawn } from "../components"; -import { FunctionBox } from "../entities"; - -export class GridSpawner extends System { - constructor() { - super(SystemNames.GridSpawner); - } - - public update(_dt: number, game: Game) { - game.forEachEntityWithComponent(ComponentNames.GridSpawn, (entity) => { - const lambdaSpawn = entity.getComponent<GridSpawn>( - ComponentNames.GridSpawn, - )!; - const hasGrid = entity.hasComponent(SystemNames.Grid); - - if (!lambdaSpawn.direction || !hasGrid) { - return; - } - - const grid = entity.getComponent<Grid>(SystemNames.Grid)!; - - const lambda = new FunctionBox(grid.gridPosition, lambdaSpawn.code); - const lambdaGrid = lambda.getComponent<Grid>(SystemNames.Grid)!; - lambdaGrid.movingDirection = lambdaSpawn.direction; - lambda.addComponent(lambdaGrid); - game.addEntity(lambda); - - lambdaSpawn.direction = null; - entity.addComponent(lambdaSpawn); - }); - } -} |