public static TrailingEffect From(TrailingEffectsDto dto) { TrailingEffect trailingEffect = new TrailingEffect(); trailingEffect.Brightness = MathUtils.GetInt(dto.Brightness, 100); trailingEffect.FlipHalfTime = MathUtils.IsChecked(dto.FlipHalfTime); trailingEffect.EffectType = dto.EffectType; trailingEffect.FadeIn = MathUtils.GetInt(dto.FadeIn); trailingEffect.FadeOut = MathUtils.GetInt(dto.FadeOut); trailingEffect.HueShift = dto.HueShift; trailingEffect.HueShiftRandom = MathUtils.GetInt(dto.HueShiftRandom); trailingEffect.LeftRightDistanceBetweenPrints = MathUtils.GetInt(dto.LeftRightDistanceBetweenPrints); trailingEffect.Lifespan = MathUtils.GetInt(dto.Lifespan); //trailingEffect.MedianSoundInterval = MathUtils.GetInt(dto.MedianSoundInterval); trailingEffect.MinForwardDistanceBetweenPrints = MathUtils.GetInt(dto.MinForwardDistanceBetweenPrints); trailingEffect.Name = dto.Name; trailingEffect.OnPrintPlaySound = dto.OnPrintPlaySound; trailingEffect.Opacity = MathUtils.GetDouble(dto.Opacity, 1); trailingEffect.Saturation = MathUtils.GetInt(dto.Saturation, 100); //trailingEffect.PlusMinusSoundInterval = MathUtils.GetInt(dto.PlusMinusSoundInterval); trailingEffect.RotationOffset = MathUtils.GetInt(dto.RotationOffset); trailingEffect.RotationOffsetRandom = MathUtils.GetInt(dto.RotationOffsetRandom); trailingEffect.StartIndex = MathUtils.GetInt(dto.StartIndex); trailingEffect.Scale = MathUtils.GetDouble(dto.Scale, 1); trailingEffect.ScaleWithVelocity = MathUtils.IsChecked(dto.ScaleWithVelocity); trailingEffect.MinScale = MathUtils.GetDouble(dto.MinScale, 0); trailingEffect.MaxScale = MathUtils.GetDouble(dto.MaxScale, double.MaxValue); trailingEffect.ScaleVariance = MathUtils.GetDouble(dto.ScaleVariance, 0); return(trailingEffect); }
static void LoadData() { trailingEffects = new List <TrailingEffect>(); List <TrailingEffectsDto> trailingEffectsDtos = CsvData.Get <TrailingEffectsDto>(Folders.InCoreData("DnD - TrailingEffects.csv"), false); foreach (TrailingEffectsDto trailingEffect in trailingEffectsDtos) { TrailingEffects.Add(TrailingEffect.From(trailingEffect)); } }
static void LoadData() { List <TrailingEffectsDto> trailingEffectsDtos = CsvToSheetsHelper.Get <TrailingEffectsDto>(Folders.InCoreData("DnD - TrailingEffects.csv")); trailingEffects = new List <TrailingEffect>(); foreach (TrailingEffectsDto trailingEffect in trailingEffectsDtos) { trailingEffects.Add(TrailingEffect.From(trailingEffect)); } }
void AddTrailingEffect(string effect) { TrailingEffect trailingEffect = AllTrailingEffects.Get(effect); if (trailingEffect == null) { return; } TrailingEffects.Add(trailingEffect); }
public static TrailingEffect GetSoft(string effectName) { if (string.IsNullOrWhiteSpace(effectName)) { return(null); } effectName = effectName.Trim(); TrailingEffect trailingEffect = TrailingEffects.FirstOrDefault(x => string.Compare(x.Name, effectName, true) == 0); string lowerEffectName = effectName.ToLower(); if (trailingEffect == null) { trailingEffect = TrailingEffects.FirstOrDefault(x => x.Name.ToLower().StartsWith(lowerEffectName)); } return(trailingEffect); }