Get the delve tour incrementer changes working and affecting fate as well

This commit is contained in:
Oliver-Akins 2025-03-01 23:40:39 -07:00
parent 7639962130
commit 110823a26b
9 changed files with 174 additions and 14 deletions

View file

@ -31,3 +31,21 @@ export function distanceBetweenFates(start, end) {
};
return 3;
};
const fateOrder = [
FatePath.WEST, // to make the .find not integer overflow
FatePath.NORTH,
FatePath.EAST,
FatePath.SOUTH,
FatePath.WEST,
];
export function nextFate(fate) {
const fateIndex = fateOrder.findIndex(f => f === fate);
return fateOrder[fateIndex + 1];
};
export function previousFate(fate) {
const fateIndex = fateOrder.lastIndexOf(fate);
return fateOrder[fateIndex - 1];
};