Actions
Improvement #1806
openMake resources path smarter
Start date:
10/03/2024
Due date:
% Done:
0%
Estimated time:
Description
- Do not go through other equipments
- Take the closest i/o slot from the other one
Updated by Axel "Elanis" Soupé about 1 month ago
function getIOPositions(origin, destination) {
const originX1 = origin.x;
const originX2 = origin.x + origin.width;
const destinationX1 = destination.x;
const destinationX2 = destination.x + destination.width;
let originIO = {
x: originX1,
y: origin.y + origin.height / 2,
};
if(Math.abs(originX1 - destinationX1) > Math.abs(originX2 - destinationX1)) {
originIO.x = originX2;
}
let destinationIO = {
x: destinationX1,
y: destination.y + destination.height / 2,
};
if(Math.abs(originX1 - destinationX1) > Math.abs(originX1 - destinationX2)) {
destinationIO.x = destinationX2;
}
return {
origin: originIO,
destination: destinationIO,
};
}
Updated by Axel "Elanis" Soupé 25 days ago
- Subject changed from Make getGridDistance() smarter to Make resources path smarter
- Description updated (diff)
Actions