コード例 #1
0
 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>();
 }
コード例 #2
0
        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;
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 public ProfileTreeBuilder(ExtensionCache extensionCache, ExtensionParameter extensionParameter)
 {
     this.ExtensionCache     = extensionCache;
     this.ExtensionParameter = extensionParameter;
 }
コード例 #5
0
ファイル: DataSource.cs プロジェクト: xinqinglhj/Chain
 /// <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()));
 }