/********* ** Public methods *********/ /// <summary>Construct an instance.</summary> /// <param name="customFarmingRedux">The Custom Farming Redux integration.</param> /// <param name="producerFrameworkMod">The Producer Framework Mod integration.</param> /// <param name="metadata">Provides metadata that's not available from the game data directly.</param> public GameHelper(CustomFarmingReduxIntegration customFarmingRedux, ProducerFrameworkModIntegration producerFrameworkMod, Metadata metadata) { this.DataParser = new DataParser(this); this.CustomFarmingRedux = customFarmingRedux; this.ProducerFrameworkMod = producerFrameworkMod; this.Metadata = metadata; }
/********* ** Public methods *********/ /// <summary>Construct an instance.</summary> /// <param name="customFarmingRedux">The Custom Farming Redux integration.</param> /// <param name="producerFrameworkMod">The Producer Framework Mod integration.</param> /// <param name="metadata">Provides metadata that's not available from the game data directly.</param> /// <param name="reflection">Simplifies access to protected code.</param> public GameHelper(CustomFarmingReduxIntegration customFarmingRedux, ProducerFrameworkModIntegration producerFrameworkMod, Metadata metadata, IReflectionHelper reflection) { this.DataParser = new DataParser(this); this.CustomFarmingRedux = customFarmingRedux; this.ProducerFrameworkMod = producerFrameworkMod; this.Metadata = metadata; this.WorldItemScanner = new WorldItemScanner(reflection); }
/********* ** Private methods *********/ /**** ** Event handlers ****/ /// <summary>The method invoked on the first update tick, once all mods are initialized.</summary> /// <param name="sender">The event sender.</param> /// <param name="e">The event data.</param> private void OnGameLaunched(object sender, GameLaunchedEventArgs e) { if (!this.IsDataValid) { return; } // get mod APIs JsonAssetsIntegration jsonAssets = new JsonAssetsIntegration(this.Helper.ModRegistry, this.Monitor); // initialize functionality var customFarming = new CustomFarmingReduxIntegration(this.Helper.ModRegistry, this.Monitor); var producerFramework = new ProducerFrameworkModIntegration(this.Helper.ModRegistry, this.Monitor); this.GameHelper = new GameHelper(customFarming, producerFramework, this.Metadata); this.TargetFactory = new TargetFactory(this.Helper.Reflection, this.GameHelper, jsonAssets, new SubjectFactory(this.Metadata, this.Helper.Translation, this.Helper.Reflection, this.GameHelper, this.Config)); this.DebugInterface = new DebugInterface(this.GameHelper, this.TargetFactory, this.Config, this.Monitor); }