1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Add sandbox building, restructure levels, show pinned shapes in constant signal dialog

This commit is contained in:
tobspr
2020-09-29 10:52:25 +02:00
parent fd3bbcdc20
commit db6db7caca
36 changed files with 499 additions and 312 deletions

View File

@@ -0,0 +1,24 @@
import { ItemProducerComponent } from "../components/item_producer";
import { GameSystemWithFilter } from "../game_system_with_filter";
export class ItemProducerSystem extends GameSystemWithFilter {
constructor(root) {
super(root, [ItemProducerComponent]);
}
update() {
for (let i = 0; i < this.allEntities.length; ++i) {
const entity = this.allEntities[i];
const pinsComp = entity.components.WiredPins;
const pin = pinsComp.slots[0];
const network = pin.linkedNetwork;
if (!network || !network.hasValue()) {
continue;
}
const ejectorComp = entity.components.ItemEjector;
ejectorComp.tryEject(0, network.currentValue);
}
}
}