Make the distanceBetweenFates more situation-complete
This commit is contained in:
parent
507913139f
commit
7c8d6a7208
1 changed files with 7 additions and 1 deletions
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue