Ejemplo n.º 1
0
        public static void LoadData()
        {
            dieRollEffects = new List <DieRollEffect>();
            List <DieRollEffectDto> dieRollEffectDtos = GoogleSheets.Get <DieRollEffectDto>(Folders.InCoreData("DnD - DieRollEffects.csv"), false);

            foreach (DieRollEffectDto dieRollEffect in dieRollEffectDtos)
            {
                DieRollEffects.Add(DieRollEffect.From(dieRollEffect));
            }
        }
Ejemplo n.º 2
0
        void AddDieRollEffect(string effect)
        {
            DieRollEffect dieRollEffect = AllDieRollEffects.Get(effect);

            if (dieRollEffect == null)
            {
                return;
            }
            NumHalos             = dieRollEffect.NumHalos;
            EffectRotation       = dieRollEffect.Rotation;
            EffectScale          = dieRollEffect.Scale;
            EffectBrightness     = dieRollEffect.Brightness;
            EffectSaturation     = dieRollEffect.Saturation;
            EffectHueShift       = dieRollEffect.HueShift;
            OnFirstContactEffect = dieRollEffect.OnFirstContactEffect;
            OnFirstContactSound  = dieRollEffect.OnFirstContactSound;
            OnThrowSound         = dieRollEffect.OnThrowSound;
            OnStopRollingSound   = dieRollEffect.OnStopRollingSound;
        }
Ejemplo n.º 3
0
        public static DieRollEffect From(DieRollEffectDto dto)
        {
            DieRollEffect result = new DieRollEffect();

            result.Name                 = dto.Name;
            result.OnThrowSound         = dto.OnThrowSound;
            result.OnFirstContactSound  = dto.OnFirstContactSound;
            result.OnFirstContactEffect = dto.OnFirstContactEffect;
            result.NumHalos             = MathUtils.GetInt(dto.NumHalos);
            result.Rotation             = MathUtils.GetInt(dto.Rotation);
            result.Scale                = MathUtils.GetDouble(dto.Scale, 1);
            result.OnStopRollingSound   = dto.OnStopRollingSound;
            result.HueShift             = dto.HueShift;
            result.Saturation           = MathUtils.GetInt(dto.Saturation, 100);
            result.Brightness           = MathUtils.GetInt(dto.Brightness, 100);


            return(result);
        }