custom jobs
This commit is contained in:
parent
6721c16d3d
commit
820ca8512f
@ -9,6 +9,7 @@ class Evolution extends Arrangement {
|
|||||||
this.setup();
|
this.setup();
|
||||||
this.productIndex = 0;
|
this.productIndex = 0;
|
||||||
this.productsAmount = [...Array(ShelfCount)].map(() => 0);
|
this.productsAmount = [...Array(ShelfCount)].map(() => 0);
|
||||||
|
this.backlog = []
|
||||||
}
|
}
|
||||||
|
|
||||||
generate() {
|
generate() {
|
||||||
@ -77,7 +78,19 @@ class Evolution extends Arrangement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addCustomJobRequest(productName, amount, x, y) {
|
||||||
|
this.backlog.push({
|
||||||
|
product: productName,
|
||||||
|
amount,
|
||||||
|
x, y
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
getJobRequest() {
|
getJobRequest() {
|
||||||
|
if (this.backlog.length > 0) {
|
||||||
|
return this.backlog.pop()
|
||||||
|
}
|
||||||
|
|
||||||
if (this.productIndex > ShelfCount)
|
if (this.productIndex > ShelfCount)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user