//TODO: add proper load functionality to this, so it loads the module rather than re-initializing it. public T Load <T>(string module, CoreAI core, DataModuleEvent <T> mEvent = null, bool usePresetEvent = true, bool usePresetData = true) where T : DataModule <T>, new() { DataModule <T> .Preset preset; if (DataModule <T> .DataPreset.TryGetValue(module, out preset)) { T newInstance = (usePresetData) ? (T)preset.Data.MemberwiseClone() : new T(); if (usePresetEvent) { preset.OnLoad(core, newInstance); } if (mEvent != null) { mEvent(core, newInstance); } return(newInstance); } return(new T()); }
public abstract void GetDataEvent(CoreAI core);