public static void Initialize(IUnityContainer container) { _container = container; _netDiskApi = container.Resolve <INetDiskApi>(); if (!File.Exists(DataFile)) { Directory.CreateDirectory(Path.GetDirectoryName(DataFile)); new ExtensionCache().Save(DataFile); } _cache = File.ReadAllText(DataFile).ToObject <ExtensionCache>(); }
public override void Initialise() { base.Initialise(); PluginName = "BuildYourOwnRoutineCore"; KeyboardHelper = new KeyboardHelper(GameController); ExtensionCache = new ExtensionCache(); ExtensionParameter = new ExtensionParameter(this); ProfileDirectory = PluginDirectory + @"/Profile/"; ExtensionDirectory = PluginDirectory + @"/Extension/"; ExtensionLoader.LoadAllExtensions(ExtensionCache, ExtensionDirectory); ProcessLoadedExtensions(); CreateAndStartTreeFromLoadedProfile(); Settings.TicksPerSecond.OnValueChanged += UpdateCoroutineWaitRender; }
public override bool Initialise() { base.Initialise(); Name = "BuildYourOwnRoutineCore"; KeyboardHelper = new KeyboardHelper(GameController); ExtensionCache = new ExtensionCache(); ExtensionParameter = new ExtensionParameter(this); ProfileDirectory = DirectoryFullName + @"/Profile/"; ExtensionDirectory = DirectoryFullName + @"/Extension/"; Directory.CreateDirectory(DirectoryFullName); Directory.CreateDirectory(ExtensionDirectory); ExtensionLoader.LoadAllExtensions(ExtensionCache, ExtensionDirectory); ProcessLoadedExtensions(); Settings.Enable.OnValueChanged += (sender, b) => { if (b) { if (Core.ParallelRunner.FindByName(buildYourOwnRoutineChecker) == null) { CreateAndStartTreeFromLoadedProfile(); } TreeCoroutine?.Resume(); } else { TreeCoroutine?.Pause(); } }; CreateAndStartTreeFromLoadedProfile(); Settings.TicksPerSecond.OnValueChanged += (sender, b) => { UpdateCoroutineWaitRender(); }; return(true); }
public ProfileTreeBuilder(ExtensionCache extensionCache, ExtensionParameter extensionParameter) { this.ExtensionCache = extensionCache; this.ExtensionParameter = extensionParameter; }
/// <summary> /// Gets the extension data. /// </summary> /// <typeparam name="TTKey">The type of extension data desired.</typeparam> /// <returns>T.</returns> /// <remarks>Chain extensions can use this to store data source specific data. The key should be a data type defined by the extension. /// /// Transactional data sources should override this method and return the value held by their parent data source.</remarks> public virtual TTKey GetExtensionData <TTKey>() where TTKey : new() { return((TTKey)ExtensionCache.GetOrAdd(typeof(TTKey), x => new TTKey())); }