Exemplo n.º 1
0
        private void IntegrateLineSprinklers()
        {
            ILineSprinklersApi api = theMod.helper.ModRegistry.GetApi <ILineSprinklersApi>("hootless.LineSprinklers");

            if (api == null)
            {
                return;
            }
            theMod.api.RemoveItemRangeHighlighter("jltaylor-us.RangeHighlight/sprinkler");
            IntegrateSprinklerCommon("jltaylor-us.RangeHighlight/line-sprinkler", api.GetSprinklerCoverage, true);
        }
        /*********
        ** Public methods
        *********/
        /// <summary>Construct an instance.</summary>
        /// <param name="modRegistry">An API for fetching metadata about loaded mods.</param>
        /// <param name="monitor">Encapsulates monitoring and logging.</param>
        public LineSprinklersIntegration(IModRegistry modRegistry, IMonitor monitor)
            : base("Line Sprinklers", "hootless.LineSprinklers", "1.1.0", modRegistry, monitor)
        {
            if (!this.IsLoaded)
            {
                return;
            }

            // get mod API
            this.ModApi    = this.GetValidatedApi <ILineSprinklersApi>();
            this.IsLoaded  = this.ModApi != null;
            this.MaxRadius = this.ModApi?.GetMaxGridSize() ?? 0;
        }