Skip to content

Commit

Permalink
feat: add Util method for predicting Items to buy
Browse files Browse the repository at this point in the history
  • Loading branch information
Computerdores committed Apr 17, 2024
1 parent cb87b62 commit 3baaa1f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions AdvancedTerminalAPI/AdvancedTerminalAPI/Vanillin/Util.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,13 @@ public static string PredictConfirmation(string partialInput)
int index = GetPlayerIndexByName(partialInput);
return index != -1 ? StartOfRound.Instance.mapScreen.radarTargets[index].name : partialInput;
}

// ReSharper disable once Unity.NoNullPropagation
public static string PredictBuyable(Terminal terminal, string partialInput)
=> FindKeyword(terminal, "buy").compatibleNouns.
VanillaStringMatch(
partialInput,
cn => cn.noun.word,
cn => cn.result.shipUnlockableID != -1 || cn.result.buyItemIndex != -1
)?.noun?.word;
}

0 comments on commit 3baaa1f

Please sign in to comment.