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); }
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); }