예제 #1
0
 //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());
 }
예제 #2
0
 public abstract void GetDataEvent(CoreAI core);