/// <summary> /// Makes the investments. /// </summary> /// <param name="settings">The settings.</param> /// <returns></returns> public bool MakeInvestments(InvestmentStrategySettings settings) { if (!settings.Enabled) { AppCore.LogAccountant.Suggestion("Инвестирование выключено.", "Автоматическое инвестирование позволит вам сохранить деньги и автоматически делать покупки. \n Зайдите в Настройки > Бухгалтерия. "); return(false); } if (skillPrices == null) { InitializeSkillsPrices(); } if (settings.Type == InvestmentStrategy.Undefined) { return(true); } var success = false; if (settings.IsSet(InvestmentStrategy.BuyMostExpensiveSkill)) { if (BuyMostExpensiveSkill()) { success = true; } } if (settings.IsSet(InvestmentStrategy.BuyMostExpensiveSkill)) { if (BuyMostExpenciveFromAvailible()) { success = true; } } if (settings.IsSet(InvestmentStrategy.BuySpecifiedSkill) && settings.SelectedSkill != SkillType.Undefined && settings.SelectedSkill != SkillType.Glory) { if (BuySpecifiedSkill(settings.SelectedSkill)) { success = true; } } if (settings.IsSet(InvestmentStrategy.BuyLowestSkill)) { if (BuyLowestSkill()) { success = true; } } return(success); }
/// <summary> /// Makes the investments. /// </summary> /// <param name="settings">The settings.</param> /// <returns></returns> private bool MakeInvestments(InvestmentStrategySettings settings) { if (!settings.Enabled) { AppCore.LogAccountant.Suggestion("Инвестирование выключено.", "Автоматическое инвестирование позволит вам сохранить деньги и автоматически делать покупки. \n Зайдите в Настройки > Бухгалтерия. "); return(false); } if (settings.Type == InvestmentStrategy.Undefined) { return(true); } var success = false; if (settings.IsSet(InvestmentStrategy.BuySpecifiedStuff)) { if (!_player.WardrobeHasEmtySlots) { AppCore.LogFights.Warn("В одевалке нет свободных мест.", "Инвестирование в шмот невозможен по причине отсутствия свободных слотов в одевалке."); } else { _tradeMaster.Matchers = settings.StuffConditions; if (_tradeMaster.InvestmentMoney()) { success = true; } } } return(success); }