static public bool ShouldBeActivePermanent(this Accumulation.IShipUiModule module, Bot bot) =>
 new[]
 {
     module?.TooltipLast?.Value?.IsHardener,
     bot?.ConfigSerialAndStruct.Value?.ModuleActivePermanentSetTitlePattern
     ?.Any(activePermanentTitlePattern => module?.TooltipLast?.Value?.TitleElementText()?.Text?.RegexMatchSuccessIgnoreCase(activePermanentTitlePattern) ?? false),
 }
 .Any(sufficientCondition => sufficientCondition ?? false);
Esempio n. 2
0
        static public bool ShouldBeActivePermanent(this Accumulation.IShipUiModule module, Bot bot)
        {
            System.Diagnostics.Debug.WriteLine($"Checking module {module.TooltipLast}" +
                                               $" IsHardener: {module?.TooltipLast?.Value?.IsHardener}" +
                                               $" IsActive: {module.IsActive(bot)}" +
                                               $" RampActive: {module.RampActive}" +
                                               $" ;RegionX: {module.Region.Min0};RegionY: {module.Region.Min1}");

            if (module?.TooltipLast?.Value?.IsHardener ?? false)
            {
                return(true);
            }

            return
                (bot?.ConfigSerialAndStruct.Value?.ModuleActivePermanentSetTitlePattern
                 ?.Any(activePermanentTitlePattern =>
                       module?.TooltipLast?.Value?.TitleElementText()?.Text
                       ?.RegexMatchSuccessIgnoreCase(activePermanentTitlePattern) ?? false) ?? false);
        }
Esempio n. 3
0
 public Int64?ToggleLastAgeStepCountFromModule(Accumulation.IShipUiModule module) =>
 stepIndex - ToggleLastStepIndexFromModule?.TryGetValueNullable(module);
Esempio n. 4
0
File: Bot.cs Progetto: Fulborg/A-Bot
 public long?ToggleLastAgeStepCountFromModule(Accumulation.IShipUiModule module) =>
 module == null ? null :
 stepIndex - ToggleLastStepIndexFromModule?.TryGetValueNullable(module);