enum and fixed products generation
This commit is contained in:
parent
5653fa6b02
commit
46156f34b8
@ -8,10 +8,7 @@
|
||||
* @property {IPosition} position
|
||||
*/
|
||||
|
||||
const PATHFINDING_ACTION = {
|
||||
ROTATE: 0,
|
||||
MOVE: 1,
|
||||
}
|
||||
const PATHFINDING_ACTION = Enum('ROTATE', 'MOVE')
|
||||
|
||||
|
||||
class Pathfinding {
|
||||
|
@ -11,7 +11,7 @@ class Products {
|
||||
const gridProductsAmountColumn = []
|
||||
|
||||
for (let j = 0; j < 9; ++j) {
|
||||
if (j % 3 != 1) {
|
||||
if (j % 3 !== 1 && i % 7 !== 0) {
|
||||
gridProductsColumn.push(Product.RANDOM_FROM_REGISTRY());
|
||||
gridProductsAmountColumn.push(floor(random() * 51));
|
||||
} else {
|
||||
|
@ -32,3 +32,12 @@ function waitFor(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