Project

General

Profile

Actions

Improvement #1806

open

Make resources path smarter

Added by Axel "Elanis" Soupé about 2 months ago. Updated 25 days ago.

Status:
Pending
Priority:
Normal
Assignee:
-
Target version:
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
Actions #1

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,
};

}

Actions #2

Updated by Axel "Elanis" Soupé 25 days ago

  • Subject changed from Make getGridDistance() smarter to Make resources path smarter
  • Description updated (diff)
Actions

Also available in: Atom PDF