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; }
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); }
/* 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) { }
public StatusModifier(StatusModifierCore core) : this(core.type, core.amount) { }