custom jobs

This commit is contained in:
Robert Bendun 2021-06-21 12:01:31 +02:00
parent 6721c16d3d
commit 820ca8512f

View File

@ -9,6 +9,7 @@ class Evolution extends Arrangement {
this.setup();
this.productIndex = 0;
this.productsAmount = [...Array(ShelfCount)].map(() => 0);
this.backlog = []
}
generate() {
@ -77,7 +78,19 @@ class Evolution extends Arrangement {
}
}
addCustomJobRequest(productName, amount, x, y) {
this.backlog.push({
product: productName,
amount,
x, y
});
}
getJobRequest() {
if (this.backlog.length > 0) {
return this.backlog.pop()
}
if (this.productIndex > ShelfCount)
return null;