示例#1
0
        public IStatusModifier <IStatus> Load()
        {
            Type template           = typeof(StatusModifier <>);
            Type type               = template.MakeGenericType(TypeUtils.StringToType(DataType));
            StatusModifierCore core = ZeroFormatterSerializer.Deserialize <StatusModifierCore>(Data);

            return((IStatusModifier <IStatus>)Activator.CreateInstance(type, args: core));
            //return res;
        }
示例#2
0
        public bool Set(ISuffix <IStatus> t)
        {
            var statusModifierCore = new StatusModifierCore {
                type = t.modifier.type, amount = t.modifier.amount
            };

            Data = ZeroFormatterSerializer.Serialize(new FigereCore {
                statusModifierCore = statusModifierCore, tier = t.tier
            });
            DataType = TypeUtils.TypeToString(t.GetType().GenericTypeArguments.First());
            return(true);
        }
示例#3
0
        /* public static new PermanentStatusModifier<T> Additive(int amount){
         *  return new PermanentStatusModifier<T>(OperatorType.Additive,amount);
         * }
         * public static new PermanentStatusModifier<T> Substractive(int amount){
         *  return new PermanentStatusModifier<T>(OperatorType.Subtractive,amount);
         * }
         * public static new PermanentStatusModifier<T> More(int amount){
         *  return new PermanentStatusModifier<T>(OperatorType.More,amount);
         * }*/

        public PermanentStatusModifier(StatusModifierCore core) : base(core)
        {
        }
示例#4
0
 public StatusModifier(StatusModifierCore core) : this(core.type, core.amount)
 {
 }