示例#1
0
 /// <summary>
 /// Saves the specified settings.
 /// </summary>
 /// <param name="settings">The settings.</param>
 public void Save(InvestmentStrategySettings settings)
 {
     settings.Type          = investmentStrategiesChekedList1.Value;
     settings.SelectedSkill = skillCombo1.SelectedSkill;
     tradeSearcherControl1.Save(settings.StuffConditions);
     settings.Enabled = boxEnabled.Checked;
 }
示例#2
0
文件: Accountant.cs 项目: minskowl/MY
        /// <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);
        }
示例#3
0
文件: Coach.cs 项目: minskowl/MY
        /// <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);
        }