using System; using UnityEngine; namespace UnityAtoms { public static class DynamicAtoms { public static V CreateVariable(T initialValue, E1 changed = null, E2 changedWithHistory = null) where V : AtomVariable where E1 : AtomEvent where E2 : AtomEvent { var sov = ScriptableObject.CreateInstance(); sov.Changed = changed; sov.ChangedWithHistory = changedWithHistory; sov.Value = initialValue; return sov; } public static L CreateList(E added = null, E removed = null, VoidEvent cleared = null) where L : AtomList where E : AtomEvent { var sol = ScriptableObject.CreateInstance(); sol.Added = added; sol.Removed = removed; sol.Cleared = cleared; return sol; } public static GA CreateAction(Action action) where GA : AtomAction { var ga = ScriptableObject.CreateInstance(); ga.Action = action; return ga; } public static GA CreateAction(Action action) where GA : AtomAction { var ga = ScriptableObject.CreateInstance(); ga.Action = action; return ga; } public static GA CreateAction(Action action) where GA : AtomAction { var ga = ScriptableObject.CreateInstance(); ga.Action = action; return ga; } public static GA CreateAction(Action action) where GA : AtomAction { var ga = ScriptableObject.CreateInstance(); ga.Action = action; return ga; } public static GA CreateAction(Action action) where GA : AtomAction { var ga = ScriptableObject.CreateInstance(); ga.Action = action; return ga; } public static GF CreateFunction(Func func) where GF : AtomFunction { var gf = ScriptableObject.CreateInstance(); gf.Func = func; return gf; } public static GF CreateFunction(Func func) where GF : AtomFunction { var gf = ScriptableObject.CreateInstance(); gf.Func = func; return gf; } public static GF CreateFunction(Func func) where GF : AtomFunction { var gf = ScriptableObject.CreateInstance(); gf.Func = func; return gf; } public static GF CreateFunction(Func func) where GF : AtomFunction { var gf = ScriptableObject.CreateInstance(); gf.Func = func; return gf; } public static GF CreateFunction(Func func) where GF : AtomFunction { var gf = ScriptableObject.CreateInstance(); gf.Func = func; return gf; } public static GF CreateFunction(Func func) where GF : AtomFunction { var gf = ScriptableObject.CreateInstance(); gf.Func = func; return gf; } } }