From 9be67109af0ffa7e161b7a8ed48eb12fcc303afe Mon Sep 17 00:00:00 2001 From: SteveBenz Date: Sat, 30 Dec 2023 11:31:47 -0800 Subject: [PATCH 1/2] Enable attachments that are commonly used and non-destructive to have a larger area of affect than potentially destructive ones --- .../Attachments/FertilizerAttachment.cs | 14 +++-------- .../Framework/Attachments/IAttachment.cs | 3 +++ .../Framework/Attachments/ScytheAttachment.cs | 9 ++----- .../Framework/Attachments/SeedAttachment.cs | 16 +++---------- .../Attachments/WateringCanAttachment.cs | 12 +++------- TractorMod/Framework/BaseAttachment.cs | 4 ++++ .../Config/ExtendedDistanceConfig.cs | 12 ++++++++++ .../Config/GenericAttachmentConfig.cs | 2 +- .../Config/IExtendedDistanceConfig.cs | 17 +++++++++++++ TractorMod/Framework/Config/ScytheConfig.cs | 5 +++- .../Config/StandardAttachmentConfig.cs | 8 +++---- .../Framework/ExtendedDistanceAttachment.cs | 23 ++++++++++++++++++ ...nericModConfigMenuIntegrationForTractor.cs | 24 +++++++++++++++++++ .../ModAttachments/SeedBagAttachment.cs | 4 ++-- TractorMod/Framework/TractorManager.cs | 10 +++++--- TractorMod/i18n/default.json | 14 ++++++++++- 16 files changed, 125 insertions(+), 52 deletions(-) create mode 100644 TractorMod/Framework/Config/ExtendedDistanceConfig.cs create mode 100644 TractorMod/Framework/Config/IExtendedDistanceConfig.cs create mode 100644 TractorMod/Framework/ExtendedDistanceAttachment.cs diff --git a/TractorMod/Framework/Attachments/FertilizerAttachment.cs b/TractorMod/Framework/Attachments/FertilizerAttachment.cs index 2022e5cc1..237af9aa5 100644 --- a/TractorMod/Framework/Attachments/FertilizerAttachment.cs +++ b/TractorMod/Framework/Attachments/FertilizerAttachment.cs @@ -8,15 +8,8 @@ namespace Pathoschild.Stardew.TractorMod.Framework.Attachments { /// An attachment for fertilizer or speed-gro. - internal class FertilizerAttachment : BaseAttachment + internal class FertilizerAttachment : ExtendedDistanceAttachment { - /********* - ** Fields - *********/ - /// The attachment settings. - private readonly GenericAttachmentConfig Config; - - /********* ** Public methods *********/ @@ -24,10 +17,9 @@ internal class FertilizerAttachment : BaseAttachment /// The attachment settings. /// Fetches metadata about loaded mods. /// Simplifies access to private code. - public FertilizerAttachment(GenericAttachmentConfig config, IModRegistry modRegistry, IReflectionHelper reflection) - : base(modRegistry, reflection) + public FertilizerAttachment(ExtendedDistanceConfig config, IModRegistry modRegistry, IReflectionHelper reflection) + : base(config, modRegistry, reflection) { - this.Config = config; } /// Get whether the tool is currently enabled. diff --git a/TractorMod/Framework/Attachments/IAttachment.cs b/TractorMod/Framework/Attachments/IAttachment.cs index 8d72b0403..8ffaa448f 100644 --- a/TractorMod/Framework/Attachments/IAttachment.cs +++ b/TractorMod/Framework/Attachments/IAttachment.cs @@ -35,6 +35,9 @@ internal interface IAttachment /// The current location. bool Apply(Vector2 tile, SObject? tileObj, TerrainFeature? tileFeature, Farmer player, Tool? tool, Item? item, GameLocation location); + /// Determines if the tool range should be applied in an extended pattern or just the core area. + bool IsDistanceExtended { get; } + /// Method called when the tractor attachments have been activated for a location. /// The current tractor location. void OnActivated(GameLocation location); diff --git a/TractorMod/Framework/Attachments/ScytheAttachment.cs b/TractorMod/Framework/Attachments/ScytheAttachment.cs index 7b00f6017..91acfbfdf 100644 --- a/TractorMod/Framework/Attachments/ScytheAttachment.cs +++ b/TractorMod/Framework/Attachments/ScytheAttachment.cs @@ -17,13 +17,11 @@ namespace Pathoschild.Stardew.TractorMod.Framework.Attachments { /// An attachment for the scythe. - internal class ScytheAttachment : BaseAttachment + internal class ScytheAttachment : ExtendedDistanceAttachment { /********* ** Fields *********/ - /// The attachment settings. - private readonly ScytheConfig Config; /// A cache of is-flower checks by item ID for . private readonly Dictionary IsFlowerCache = new(); @@ -37,10 +35,7 @@ internal class ScytheAttachment : BaseAttachment /// Fetches metadata about loaded mods. /// Simplifies access to private code. public ScytheAttachment(ScytheConfig config, IModRegistry modRegistry, IReflectionHelper reflection) - : base(modRegistry, reflection) - { - this.Config = config; - } + : base(config, modRegistry, reflection) { } /// Get whether the tool is currently enabled. /// The current player. diff --git a/TractorMod/Framework/Attachments/SeedAttachment.cs b/TractorMod/Framework/Attachments/SeedAttachment.cs index dd58d0bbe..1bfe1b1c4 100644 --- a/TractorMod/Framework/Attachments/SeedAttachment.cs +++ b/TractorMod/Framework/Attachments/SeedAttachment.cs @@ -11,15 +11,8 @@ namespace Pathoschild.Stardew.TractorMod.Framework.Attachments { /// An attachment for seeds. - internal class SeedAttachment : BaseAttachment + internal class SeedAttachment : ExtendedDistanceAttachment { - /********* - ** Fields - *********/ - /// The attachment settings. - private readonly GenericAttachmentConfig Config; - - /********* ** Public methods *********/ @@ -27,11 +20,8 @@ internal class SeedAttachment : BaseAttachment /// The attachment settings. /// Fetches metadata about loaded mods. /// Simplifies access to private code. - public SeedAttachment(GenericAttachmentConfig config, IModRegistry modRegistry, IReflectionHelper reflection) - : base(modRegistry, reflection) - { - this.Config = config; - } + public SeedAttachment(ExtendedDistanceConfig config, IModRegistry modRegistry, IReflectionHelper reflection) + : base(config, modRegistry, reflection) { } /// Get whether the tool is currently enabled. /// The current player. diff --git a/TractorMod/Framework/Attachments/WateringCanAttachment.cs b/TractorMod/Framework/Attachments/WateringCanAttachment.cs index 622610ff9..d7728729d 100644 --- a/TractorMod/Framework/Attachments/WateringCanAttachment.cs +++ b/TractorMod/Framework/Attachments/WateringCanAttachment.cs @@ -10,14 +10,11 @@ namespace Pathoschild.Stardew.TractorMod.Framework.Attachments { /// An attachment for the watering can. - internal class WateringCanAttachment : BaseAttachment + internal class WateringCanAttachment : ExtendedDistanceAttachment { /********* ** Fields *********/ - /// The attachment settings. - private readonly GenericAttachmentConfig Config; - /// An infinite watering can to apply. private readonly WateringCan WateringCan = new() { @@ -34,11 +31,8 @@ internal class WateringCanAttachment : BaseAttachment /// The attachment settings. /// Fetches metadata about loaded mods. /// Simplifies access to private code. - public WateringCanAttachment(GenericAttachmentConfig config, IModRegistry modRegistry, IReflectionHelper reflection) - : base(modRegistry, reflection) - { - this.Config = config; - } + public WateringCanAttachment(ExtendedDistanceConfig config, IModRegistry modRegistry, IReflectionHelper reflection) + : base(config, modRegistry, reflection) { } /// Get whether the tool is currently enabled. /// The current player. diff --git a/TractorMod/Framework/BaseAttachment.cs b/TractorMod/Framework/BaseAttachment.cs index 1f64fba87..2f87d1fd5 100644 --- a/TractorMod/Framework/BaseAttachment.cs +++ b/TractorMod/Framework/BaseAttachment.cs @@ -65,6 +65,10 @@ internal abstract class BaseAttachment : IAttachment /// The current location. public abstract bool Apply(Vector2 tile, SObject? tileObj, TerrainFeature? tileFeature, Farmer player, Tool? tool, Item? item, GameLocation location); + /// Determines if the tool range should be applied in an extended pattern or just the core area. + public virtual bool IsDistanceExtended => false; + + /// Method called when the tractor attachments have been activated for a location. /// The current tractor location. public virtual void OnActivated(GameLocation location) diff --git a/TractorMod/Framework/Config/ExtendedDistanceConfig.cs b/TractorMod/Framework/Config/ExtendedDistanceConfig.cs new file mode 100644 index 000000000..dcf20d80f --- /dev/null +++ b/TractorMod/Framework/Config/ExtendedDistanceConfig.cs @@ -0,0 +1,12 @@ +namespace Pathoschild.Stardew.TractorMod.Framework.Config +{ + /// Configuration for an attachment which just has on/off and might be long-range. + internal class ExtendedDistanceConfig : IExtendedDistanceConfig + { + /// Whether to enable the attachment. + public bool Enable { get; set; } = true; + + /// If true, causes the area of effect to be increased somewhat from + public bool IncreaseDistance { get; set; } = true; + } +} diff --git a/TractorMod/Framework/Config/GenericAttachmentConfig.cs b/TractorMod/Framework/Config/GenericAttachmentConfig.cs index 4fb10df9c..d0aa7487d 100644 --- a/TractorMod/Framework/Config/GenericAttachmentConfig.cs +++ b/TractorMod/Framework/Config/GenericAttachmentConfig.cs @@ -1,6 +1,6 @@ namespace Pathoschild.Stardew.TractorMod.Framework.Config { - /// Configuration for an attachment which can only be enabled or disabled. + /// Configuration for an attachment which has no extra modalities - just on or off. internal class GenericAttachmentConfig { /// Whether to enable the attachment. diff --git a/TractorMod/Framework/Config/IExtendedDistanceConfig.cs b/TractorMod/Framework/Config/IExtendedDistanceConfig.cs new file mode 100644 index 000000000..6b5c87d08 --- /dev/null +++ b/TractorMod/Framework/Config/IExtendedDistanceConfig.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Pathoschild.Stardew.TractorMod.Framework.Config +{ + /// + /// Attachments that can affect a wider radius implement this config + /// + internal interface IExtendedDistanceConfig + { + /// If true, causes the area of effect to be increased somewhat from + public bool IncreaseDistance { get; set; } + } +} diff --git a/TractorMod/Framework/Config/ScytheConfig.cs b/TractorMod/Framework/Config/ScytheConfig.cs index 859ed0850..8fd90d7e5 100644 --- a/TractorMod/Framework/Config/ScytheConfig.cs +++ b/TractorMod/Framework/Config/ScytheConfig.cs @@ -1,7 +1,7 @@ namespace Pathoschild.Stardew.TractorMod.Framework.Config { /// Configuration for the scythe attachment. - internal class ScytheConfig + internal class ScytheConfig : IExtendedDistanceConfig { /// Whether to harvest crops. public bool HarvestCrops { get; set; } = true; @@ -29,5 +29,8 @@ internal class ScytheConfig /// Whether to clear weeds. public bool ClearWeeds { get; set; } = true; + + /// + public bool IncreaseDistance { get; set; } = true; } } diff --git a/TractorMod/Framework/Config/StandardAttachmentConfig.cs b/TractorMod/Framework/Config/StandardAttachmentConfig.cs index b76064a65..557de89e1 100644 --- a/TractorMod/Framework/Config/StandardAttachmentConfig.cs +++ b/TractorMod/Framework/Config/StandardAttachmentConfig.cs @@ -7,7 +7,7 @@ internal class StandardAttachmentsConfig public AxeConfig Axe { get; set; } = new(); /// Configuration for the fertilizer attachment. - public GenericAttachmentConfig Fertilizer { get; set; } = new(); + public ExtendedDistanceConfig Fertilizer { get; set; } = new() { IncreaseDistance = false }; /// Configuration for the grass starter attachment. public GenericAttachmentConfig GrassStarter { get; set; } = new(); @@ -34,7 +34,7 @@ internal class StandardAttachmentsConfig public ScytheConfig Scythe { get; set; } = new(); /// Configuration for the seeds attachment. - public GenericAttachmentConfig Seeds { get; set; } = new(); + public ExtendedDistanceConfig Seeds { get; set; } = new() { IncreaseDistance = false }; /// Configuration for the shears attachment. public GenericAttachmentConfig Shears { get; set; } = new(); @@ -43,9 +43,9 @@ internal class StandardAttachmentsConfig public GenericAttachmentConfig Slingshot { get; set; } = new() { Enable = false }; /// Configuration for the watering can attachment. - public GenericAttachmentConfig WateringCan { get; set; } = new(); + public ExtendedDistanceConfig WateringCan { get; set; } = new(); /// Configuration for the Seed Bag mod attachment. - public GenericAttachmentConfig SeedBagMod { get; set; } = new(); + public ExtendedDistanceConfig SeedBagMod { get; set; } = new(); } } diff --git a/TractorMod/Framework/ExtendedDistanceAttachment.cs b/TractorMod/Framework/ExtendedDistanceAttachment.cs new file mode 100644 index 000000000..93b742bed --- /dev/null +++ b/TractorMod/Framework/ExtendedDistanceAttachment.cs @@ -0,0 +1,23 @@ +using Pathoschild.Stardew.TractorMod.Framework.Config; +using StardewModdingAPI; +using StardewValley; + +namespace Pathoschild.Stardew.TractorMod.Framework +{ + internal abstract class ExtendedDistanceAttachment : BaseAttachment + where TConfig : IExtendedDistanceConfig + + { + /// Construct an instance. + /// The mod configuration. + protected ExtendedDistanceAttachment(TConfig config, IModRegistry modRegistry, IReflectionHelper reflection, int rateLimit = 0) + : base(modRegistry, reflection, rateLimit) + { + this.Config = config; + } + + protected TConfig Config { get; } + + public override bool IsDistanceExtended => this.Config.IncreaseDistance; + } +} diff --git a/TractorMod/Framework/GenericModConfigMenuIntegrationForTractor.cs b/TractorMod/Framework/GenericModConfigMenuIntegrationForTractor.cs index b333d4a48..36a9c1c5c 100644 --- a/TractorMod/Framework/GenericModConfigMenuIntegrationForTractor.cs +++ b/TractorMod/Framework/GenericModConfigMenuIntegrationForTractor.cs @@ -286,6 +286,12 @@ public void Register() // scythe .AddSectionTitle(I18n.Config_Scythe) + .AddCheckbox( + name: I18n.Config_IncreaseScytheDistance, + tooltip: I18n.Config_IncreaseScytheDistance_Tooltip, + get: config => config.StandardAttachments.Scythe.IncreaseDistance, + set: (config, value) => config.StandardAttachments.Scythe.IncreaseDistance = value + ) .AddCheckbox( name: I18n.Config_HarvestCrops_Name, tooltip: I18n.Config_HarvestCrops_Tooltip, @@ -412,12 +418,24 @@ public void Register() get: config => config.StandardAttachments.WateringCan.Enable, set: (config, value) => config.StandardAttachments.WateringCan.Enable = value ) + .AddCheckbox( + name: I18n.Config_IncreaseWateringCanDistance, + tooltip: I18n.Config_IncreaseWateringCanDistance_Tooltip, + get: config => config.StandardAttachments.WateringCan.IncreaseDistance, + set: (config, value) => config.StandardAttachments.WateringCan.IncreaseDistance = value + ) .AddCheckbox( name: I18n.Config_Fertilizer_Name, tooltip: I18n.Config_Fertilizer_Tooltip, get: config => config.StandardAttachments.Fertilizer.Enable, set: (config, value) => config.StandardAttachments.Fertilizer.Enable = value ) + .AddCheckbox( + name: I18n.Config_IncreaseFertilizerDistance, + tooltip: I18n.Config_IncreaseFertilizerDistance_Tooltip, + get: config => config.StandardAttachments.Fertilizer.IncreaseDistance, + set: (config, value) => config.StandardAttachments.Fertilizer.IncreaseDistance = value + ) .AddCheckbox( name: I18n.Config_GrassStarters_Name, tooltip: I18n.Config_GrassStarters_Tooltip, @@ -430,6 +448,12 @@ public void Register() get: config => config.StandardAttachments.Seeds.Enable, set: (config, value) => config.StandardAttachments.Seeds.Enable = value ) + .AddCheckbox( + name: I18n.Config_IncreaseSeedingDistance, + tooltip: I18n.Config_IncreaseSeedingDistance_Tooltip, + get: config => config.StandardAttachments.Seeds.IncreaseDistance || config.StandardAttachments.SeedBagMod.IncreaseDistance, + set: (config, value) => { config.StandardAttachments.Seeds.IncreaseDistance = value; config.StandardAttachments.SeedBagMod.IncreaseDistance = value; } + ) .AddCheckbox( name: I18n.Config_SeedBags_Name, tooltip: I18n.Config_SeedBags_Tooltip, diff --git a/TractorMod/Framework/ModAttachments/SeedBagAttachment.cs b/TractorMod/Framework/ModAttachments/SeedBagAttachment.cs index 9d7c01824..be3947f62 100644 --- a/TractorMod/Framework/ModAttachments/SeedBagAttachment.cs +++ b/TractorMod/Framework/ModAttachments/SeedBagAttachment.cs @@ -15,7 +15,7 @@ internal class SeedBagAttachment : BaseAttachment ** Fields *********/ /// The attachment settings. - private readonly GenericAttachmentConfig Config; + private readonly ExtendedDistanceConfig Config; /********* @@ -32,7 +32,7 @@ internal class SeedBagAttachment : BaseAttachment /// The attachment settings. /// Fetches metadata about loaded mods. /// Simplifies access to private code. - public SeedBagAttachment(GenericAttachmentConfig config, IModRegistry modRegistry, IReflectionHelper reflection) + public SeedBagAttachment(ExtendedDistanceConfig config, IModRegistry modRegistry, IReflectionHelper reflection) : base(modRegistry, reflection) { this.Config = config; diff --git a/TractorMod/Framework/TractorManager.cs b/TractorMod/Framework/TractorManager.cs index a1d4506ec..9e9f12d63 100644 --- a/TractorMod/Framework/TractorManager.cs +++ b/TractorMod/Framework/TractorManager.cs @@ -331,13 +331,16 @@ private void UpdateAttachmentEffects() // This must be done outside the temporary interaction block below, since that dismounts // the player which changes their position from what the player may expect. Vector2 origin = Game1.player.Tile; - Vector2[] grid = this.GetTileGrid(origin, this.Config.Distance).ToArray(); + HashSet coreGrid = this.GetTileGrid(origin, this.Config.Distance).ToHashSet(); + Vector2[] extendedGrid = this.GetTileGrid(origin, this.Config.Distance+1).ToArray(); // apply tools this.TemporarilyFakeInteraction(() => { - foreach (Vector2 tile in grid) + foreach (Vector2 tile in extendedGrid) { + bool isCoreTile = coreGrid.Contains(tile); + // face tile to avoid game skipping interaction this.GetRadialAdjacentTile(origin, tile, out Vector2 adjacentTile, out int facingDirection); player.Position = adjacentTile * Game1.tileSize; @@ -348,7 +351,8 @@ private void UpdateAttachmentEffects() location.terrainFeatures.TryGetValue(tile, out TerrainFeature? tileFeature); foreach (IAttachment attachment in attachments) { - if (attachment.Apply(tile, tileObj, tileFeature, Game1.player, tool, item, Game1.currentLocation)) + if ((isCoreTile || attachment.IsDistanceExtended) + && attachment.Apply(tile, tileObj, tileFeature, Game1.player, tool, item, Game1.currentLocation)) { this.ResetCooldown(attachment); break; diff --git a/TractorMod/i18n/default.json b/TractorMod/i18n/default.json index c14291615..da645d9bf 100644 --- a/TractorMod/i18n/default.json +++ b/TractorMod/i18n/default.json @@ -210,5 +210,17 @@ "config.slingshot.tooltip": "Whether to fire the slingshot towards the cursor. (This is massively overpowered and will consume ammo voraciously due to the tractor tool speed.)", "config.custom-tool-names.name": "Custom Tool Names", - "config.custom-tool-names.tooltip": "The custom items/tools to enable while riding the tractor. Tools will be used on each surrounding tile, while items will be put down. If you specify something that's already supported (like the axe), this overrides all limitations on its use. You must specify the exact internal name (not the translated display name), like 'Axe' or 'Mega Bomb'. Separate multiple values with commas." + "config.custom-tool-names.tooltip": "The custom items/tools to enable while riding the tractor. Tools will be used on each surrounding tile, while items will be put down. If you specify something that's already supported (like the axe), this overrides all limitations on its use. You must specify the exact internal name (not the translated display name), like 'Axe' or 'Mega Bomb'. Separate multiple values with commas.", + + "config.increase-scythe-distance": "Increase Scythe Distance", + "config.increase-scythe-distance.tooltip": "Whether to make the scythe tool affect an area around the tractor one tile wider than the base distance (e.g. with this checked, the scythe will affect a 5x5 area while the hoe only affects 3x3)", + + "config.increase-watering-can-distance": "Increase Watering Can Distance", + "config.increase-watering-can-distance.tooltip": "Whether to make the watering can affect an area around the tractor one tile wider than the base distance (e.g. with this checked, water will spray over a 5x5 area while the hoe only affects 3x3)", + + "config.increase-fertilizer-distance": "Increase Fertilizer Distance", + "config.increase-fertilizer-distance.tooltip": "Whether to make spreading fertilizer affect an area around the tractor one tile wide than the base distance (e.g. with this checked, fertilizer will spray over a 5x5 area while the hoe only affects 3x3)", + + "config.increase-seeding-distance": "Increase Seeder Distance", + "config.increase-seeding-distance.tooltip": "Whether to make seed spreading affect an area around the tractor one tile wide than the base distance (e.g. with this checked, seeds will affect a 5x5 area while the hoe only affects 3x3)" } From f83f5e866261ea7d77d53fa6d3129b54e7bd3d7c Mon Sep 17 00:00:00 2001 From: SteveBenz Date: Sat, 30 Dec 2023 12:48:39 -0800 Subject: [PATCH 2/2] Reverted unneeded changes, cleaned some usings, and updated comments --- TractorMod/Framework/Config/GenericAttachmentConfig.cs | 2 +- TractorMod/Framework/Config/IExtendedDistanceConfig.cs | 6 ------ TractorMod/Framework/Config/ScytheConfig.cs | 2 +- TractorMod/Framework/ExtendedDistanceAttachment.cs | 8 ++++++-- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/TractorMod/Framework/Config/GenericAttachmentConfig.cs b/TractorMod/Framework/Config/GenericAttachmentConfig.cs index d0aa7487d..4fb10df9c 100644 --- a/TractorMod/Framework/Config/GenericAttachmentConfig.cs +++ b/TractorMod/Framework/Config/GenericAttachmentConfig.cs @@ -1,6 +1,6 @@ namespace Pathoschild.Stardew.TractorMod.Framework.Config { - /// Configuration for an attachment which has no extra modalities - just on or off. + /// Configuration for an attachment which can only be enabled or disabled. internal class GenericAttachmentConfig { /// Whether to enable the attachment. diff --git a/TractorMod/Framework/Config/IExtendedDistanceConfig.cs b/TractorMod/Framework/Config/IExtendedDistanceConfig.cs index 6b5c87d08..68c716170 100644 --- a/TractorMod/Framework/Config/IExtendedDistanceConfig.cs +++ b/TractorMod/Framework/Config/IExtendedDistanceConfig.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace Pathoschild.Stardew.TractorMod.Framework.Config { /// diff --git a/TractorMod/Framework/Config/ScytheConfig.cs b/TractorMod/Framework/Config/ScytheConfig.cs index 8fd90d7e5..32b0de073 100644 --- a/TractorMod/Framework/Config/ScytheConfig.cs +++ b/TractorMod/Framework/Config/ScytheConfig.cs @@ -30,7 +30,7 @@ internal class ScytheConfig : IExtendedDistanceConfig /// Whether to clear weeds. public bool ClearWeeds { get; set; } = true; - /// + /// If true, causes the area of effect to be increased somewhat from public bool IncreaseDistance { get; set; } = true; } } diff --git a/TractorMod/Framework/ExtendedDistanceAttachment.cs b/TractorMod/Framework/ExtendedDistanceAttachment.cs index 93b742bed..d0f5a8404 100644 --- a/TractorMod/Framework/ExtendedDistanceAttachment.cs +++ b/TractorMod/Framework/ExtendedDistanceAttachment.cs @@ -1,23 +1,27 @@ using Pathoschild.Stardew.TractorMod.Framework.Config; using StardewModdingAPI; -using StardewValley; namespace Pathoschild.Stardew.TractorMod.Framework { + /// The base class for attachments that can operate over a larger area. + /// + /// The type of the config file. internal abstract class ExtendedDistanceAttachment : BaseAttachment where TConfig : IExtendedDistanceConfig { /// Construct an instance. - /// The mod configuration. + /// The configuration for the attachment. protected ExtendedDistanceAttachment(TConfig config, IModRegistry modRegistry, IReflectionHelper reflection, int rateLimit = 0) : base(modRegistry, reflection, rateLimit) { this.Config = config; } + /// The configuration for the attachment. protected TConfig Config { get; } + /// If true, the attachment's area of affect should be expanded by a tile. public override bool IsDistanceExtended => this.Config.IncreaseDistance; } }