Make the distanceBetweenFates more situation-complete

This commit is contained in:
Oliver-Akins 2025-03-01 19:20:21 -07:00
parent 507913139f
commit 7c8d6a7208

View file

@ -14,12 +14,18 @@ export function distanceBetweenFates(start, end) {
return undefined;
};
if (isOppositeFates(start, end)) {
if (start === end) {
return 0;
};
if (isOppositeFates(start, end) || isOppositeFates(end, start)) {
return 2;
};
let isForward = start === FatePath.SOUTH && end === FatePath.WEST;
isForward ||= start === FatePath.NORTH && end === FatePath.EAST;
isForward ||= start === FatePath.WEST && end === FatePath.NORTH;
isForward ||= start === FatePath.EAST && end === FatePath.SOUTH;
if (isForward) {
return 1;
};