Exemple #1
0
        public ITimedEffect ReadEffect()
        {
            ITimedEffect result = EffectHelper.CreateEmpty(reader.ReadString());

            result.BaseTime      = reader.ReadSingle();
            result.DeltaTime     = reader.ReadSingle();
            result.BaseDuration  = reader.ReadSingle();
            result.DeltaDuration = reader.ReadSingle();
            int paramcount = reader.ReadInt32();

            string[] eparams = new string[paramcount];
            for (int i = 0; i < paramcount; i++)
            {
                eparams[i] = reader.ReadString();
            }
            result.SetParamValues(eparams);
            return(result);
        }
Exemple #2
0
        public void SaveAndQuit()
        {
            AbilityEffectDefinition aed = AbilityEffectDefinition.GetDefinition(CurrentEffect.EffectType);

            this.label1.Text = aed.FriendlyName;
            string[] values = new string[aed.parameters.Count];

            for (int i = 0; i < aed.parameters.Count; i++)
            {
                string name  = aed.parameters[i].Item1;
                char   ptype = aed.parameters[i].Item2;

                values[i] = GetValue(Inputs[i * 2]) + "," + GetValue(Inputs[i * 2 + 1]);
            }
            CurrentEffect.SetParamValues(values);

            CurrentEffect.BaseTime      = (float)basetimevalue.Value;
            CurrentEffect.DeltaTime     = (float)deltatimevalue.Value;
            CurrentEffect.BaseDuration  = (float)basedurationvalue.Value;
            CurrentEffect.DeltaDuration = (float)deltadurationvalue.Value;

            this.Close();
        }