public abstract class Singleton<T> where T : Singleton<T>, new()
private static T instance;
public static T Instance
return instance == null ? new T() : instance;
}
public abstract class ProcessManager<TEnum> : Singleton<ProcessManager<TEnum>> where TEnum : Enum, new()
private TEnum state;
private Dictionary<TEnum, Action> stateInitializations = new Dictionary<TEnum, Action>();
public TEnum State
get { return state; }
set { InitializeState(state); }
private void InitializeState(TEnum _state)
stateInitializations[_state].Invoke();