enum and fixed products generation
This commit is contained in:
parent
5653fa6b02
commit
46156f34b8
@ -8,10 +8,7 @@
|
|||||||
* @property {IPosition} position
|
* @property {IPosition} position
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const PATHFINDING_ACTION = {
|
const PATHFINDING_ACTION = Enum('ROTATE', 'MOVE')
|
||||||
ROTATE: 0,
|
|
||||||
MOVE: 1,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
class Pathfinding {
|
class Pathfinding {
|
||||||
|
@ -11,7 +11,7 @@ class Products {
|
|||||||
const gridProductsAmountColumn = []
|
const gridProductsAmountColumn = []
|
||||||
|
|
||||||
for (let j = 0; j < 9; ++j) {
|
for (let j = 0; j < 9; ++j) {
|
||||||
if (j % 3 != 1) {
|
if (j % 3 !== 1 && i % 7 !== 0) {
|
||||||
gridProductsColumn.push(Product.RANDOM_FROM_REGISTRY());
|
gridProductsColumn.push(Product.RANDOM_FROM_REGISTRY());
|
||||||
gridProductsAmountColumn.push(floor(random() * 51));
|
gridProductsAmountColumn.push(floor(random() * 51));
|
||||||
} else {
|
} else {
|
||||||
|
@ -32,3 +32,12 @@ function waitFor(miliseconds) {
|
|||||||
setTimeout(() => resolve(), miliseconds);
|
setTimeout(() => resolve(), miliseconds);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Enum(...labels) {
|
||||||
|
const e = {}
|
||||||
|
let i = 0
|
||||||
|
for (const label of labels) {
|
||||||
|
e[e[label] = i] = label;
|
||||||
|
}
|
||||||
|
return e
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user