work on memory
This commit is contained in:
parent
2f652aa1b7
commit
6e9d89b045
28 changed files with 3590 additions and 111 deletions
|
|
@ -1,5 +1,6 @@
|
|||
using Automata.Core;
|
||||
using Automata.Game;
|
||||
using Automata.Items;
|
||||
using Serilog;
|
||||
|
||||
namespace Automata.Bot;
|
||||
|
|
@ -193,6 +194,31 @@ public class CraftingExecutor
|
|||
{
|
||||
if (string.IsNullOrEmpty(itemText)) return false;
|
||||
|
||||
// Try Sidekick parsed matching first
|
||||
try
|
||||
{
|
||||
var item = ItemReader.ParseItemText(itemText);
|
||||
if (item != null)
|
||||
{
|
||||
var statTexts = item.Stats.Select(s => s.Text).ToList();
|
||||
if (matchAll)
|
||||
{
|
||||
return requiredMods.All(mod =>
|
||||
statTexts.Any(st => st.Contains(mod, StringComparison.OrdinalIgnoreCase)));
|
||||
}
|
||||
else
|
||||
{
|
||||
return requiredMods.Any(mod =>
|
||||
statTexts.Any(st => st.Contains(mod, StringComparison.OrdinalIgnoreCase)));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Fall through to raw matching
|
||||
}
|
||||
|
||||
// Fallback: raw substring matching
|
||||
if (matchAll)
|
||||
{
|
||||
return requiredMods.All(mod =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue