예제 #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);
        }