示例#1
0
文件: Utils.cs 项目: bildukas86/bots
        public static bool GetRuleConfigVolume(RuleConfiguration ruleConfig, ref VolumeConfiguration VolumeConfig)
        {
            if (ruleConfig.Params.TryGetValue(RuleConfiguration.VOLUME, out object paramObj))
            {
                VolumeConfig = JsonConvert.DeserializeObject <VolumeConfiguration>(paramObj.ToString());

                if (VolumeConfig == null)
                {
                    return(false);
                }
            }
            return(true);
        }
示例#2
0
        private bool Initilise(RuleConfiguration ruleConfig)
        {
            VolumeConfiguration VolumeConfiguration = null;

            if (Utils.GetRuleConfigVolume(ruleConfig, ref VolumeConfiguration))
            {
                return(false);
            }

            this.EnableDynamicVolumeIncrease = VolumeConfiguration.EnableDynamicVolumeIncrease;
            this.Type       = VolumeConfiguration.Type;
            this.VolumeBase = VolumeConfiguration.VolumeBase;
            this.VolumeMax  = VolumeConfiguration.VolumeMax;
            this.IncreaseVolumeAfterOrders = VolumeConfiguration.IncreaseVolumeAfterOrders;
            this.VolumeIncreaseFactor      = VolumeConfiguration.VolumeIncreaseFactor;
            return(true);
        }