summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/SMAPI.Toolkit/SemanticVersion.cs47
-rw-r--r--src/SMAPI/Framework/Content/AssetData.cs7
-rw-r--r--src/SMAPI/Framework/Content/AssetDataForImage.cs13
-rw-r--r--src/SMAPI/Framework/Content/AssetDataForMap.cs5
-rw-r--r--src/SMAPI/Framework/Content/AssetDataForObject.cs15
-rw-r--r--src/SMAPI/Framework/Content/AssetInfo.cs9
-rw-r--r--src/SMAPI/Framework/ContentPack.cs31
-rw-r--r--src/SMAPI/Framework/CursorPosition.cs11
-rw-r--r--src/SMAPI/Framework/GameVersion.cs2
-rw-r--r--src/SMAPI/Framework/ModHelpers/BaseHelper.cs4
-rw-r--r--src/SMAPI/Framework/ModHelpers/CommandHelper.cs13
-rw-r--r--src/SMAPI/Framework/ModHelpers/ContentHelper.cs41
-rw-r--r--src/SMAPI/Framework/ModHelpers/ContentPackHelper.cs13
-rw-r--r--src/SMAPI/Framework/ModHelpers/DataHelper.cs34
-rw-r--r--src/SMAPI/Framework/ModHelpers/InputHelper.cs14
-rw-r--r--src/SMAPI/Framework/ModHelpers/ModHelper.cs31
-rw-r--r--src/SMAPI/Framework/ModHelpers/ModRegistryHelper.cs15
-rw-r--r--src/SMAPI/Framework/ModHelpers/MultiplayerHelper.cs19
-rw-r--r--src/SMAPI/Framework/ModHelpers/ReflectionHelper.cs34
-rw-r--r--src/SMAPI/Framework/ModHelpers/TranslationHelper.cs13
-rw-r--r--src/SMAPI/Framework/Monitor.cs13
-rw-r--r--src/SMAPI/Framework/Networking/MultiplayerPeer.cs18
-rw-r--r--src/SMAPI/Framework/Networking/MultiplayerPeerMod.cs6
-rw-r--r--src/SMAPI/Framework/Reflection/ReflectedField.cs7
-rw-r--r--src/SMAPI/Framework/Reflection/ReflectedMethod.cs9
-rw-r--r--src/SMAPI/Framework/Reflection/ReflectedProperty.cs7
-rw-r--r--src/SMAPI/Patches/DialogueErrorPatch.cs6
-rw-r--r--src/SMAPI/Patches/EventErrorPatch.cs5
-rw-r--r--src/SMAPI/Patches/LoadContextPatch.cs5
-rw-r--r--src/SMAPI/Patches/LoadErrorPatch.cs5
-rw-r--r--src/SMAPI/Patches/ObjectErrorPatch.cs5
-rw-r--r--src/SMAPI/Patches/ScheduleErrorPatch.cs5
-rw-r--r--src/SMAPI/SemanticVersion.cs47
33 files changed, 160 insertions, 349 deletions
diff --git a/src/SMAPI.Toolkit/SemanticVersion.cs b/src/SMAPI.Toolkit/SemanticVersion.cs
index 1a76bec3..0f341665 100644
--- a/src/SMAPI.Toolkit/SemanticVersion.cs
+++ b/src/SMAPI.Toolkit/SemanticVersion.cs
@@ -25,22 +25,22 @@ namespace StardewModdingAPI.Toolkit
/*********
** Accessors
*********/
- /// <summary>The major version incremented for major API changes.</summary>
+ /// <inheritdoc />
public int MajorVersion { get; }
- /// <summary>The minor version incremented for backwards-compatible changes.</summary>
+ /// <inheritdoc />
public int MinorVersion { get; }
- /// <summary>The patch version for backwards-compatible bug fixes.</summary>
+ /// <inheritdoc />
public int PatchVersion { get; }
/// <summary>The platform release. This is a non-standard semver extension used by Stardew Valley on ported platforms to represent platform-specific patches to a ported version, represented as a fourth number in the version string.</summary>
public int PlatformRelease { get; }
- /// <summary>An optional prerelease tag.</summary>
+ /// <inheritdoc />
public string PrereleaseTag { get; }
- /// <summary>Optional build metadata. This is ignored when determining version precedence.</summary>
+ /// <inheritdoc />
public string BuildMetadata { get; }
@@ -103,9 +103,7 @@ namespace StardewModdingAPI.Toolkit
this.AssertValid();
}
- /// <summary>Get an integer indicating whether this version precedes (less than 0), supersedes (more than 0), or is equivalent to (0) the specified version.</summary>
- /// <param name="other">The version to compare with this instance.</param>
- /// <exception cref="ArgumentNullException">The <paramref name="other"/> value is null.</exception>
+ /// <inheritdoc />
public int CompareTo(ISemanticVersion other)
{
if (other == null)
@@ -113,68 +111,55 @@ namespace StardewModdingAPI.Toolkit
return this.CompareTo(other.MajorVersion, other.MinorVersion, other.PatchVersion, (other as SemanticVersion)?.PlatformRelease ?? 0, other.PrereleaseTag);
}
- /// <summary>Indicates whether the current object is equal to another object of the same type.</summary>
- /// <returns>true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false.</returns>
- /// <param name="other">An object to compare with this object.</param>
+ /// <inheritdoc />
public bool Equals(ISemanticVersion other)
{
return other != null && this.CompareTo(other) == 0;
}
- /// <summary>Whether this is a prerelease version.</summary>
+ /// <inheritdoc />
public bool IsPrerelease()
{
return !string.IsNullOrWhiteSpace(this.PrereleaseTag);
}
- /// <summary>Get whether this version is older than the specified version.</summary>
- /// <param name="other">The version to compare with this instance.</param>
+ /// <inheritdoc />
public bool IsOlderThan(ISemanticVersion other)
{
return this.CompareTo(other) < 0;
}
- /// <summary>Get whether this version is older than the specified version.</summary>
- /// <param name="other">The version to compare with this instance.</param>
- /// <exception cref="FormatException">The specified version is not a valid semantic version.</exception>
+ /// <inheritdoc />
public bool IsOlderThan(string other)
{
return this.IsOlderThan(new SemanticVersion(other, allowNonStandard: true));
}
- /// <summary>Get whether this version is newer than the specified version.</summary>
- /// <param name="other">The version to compare with this instance.</param>
+ /// <inheritdoc />
public bool IsNewerThan(ISemanticVersion other)
{
return this.CompareTo(other) > 0;
}
- /// <summary>Get whether this version is newer than the specified version.</summary>
- /// <param name="other">The version to compare with this instance.</param>
- /// <exception cref="FormatException">The specified version is not a valid semantic version.</exception>
+ /// <inheritdoc />
public bool IsNewerThan(string other)
{
return this.IsNewerThan(new SemanticVersion(other, allowNonStandard: true));
}
- /// <summary>Get whether this version is between two specified versions (inclusively).</summary>
- /// <param name="min">The minimum version.</param>
- /// <param name="max">The maximum version.</param>
+ /// <inheritdoc />
public bool IsBetween(ISemanticVersion min, ISemanticVersion max)
{
return this.CompareTo(min) >= 0 && this.CompareTo(max) <= 0;
}
- /// <summary>Get whether this version is between two specified versions (inclusively).</summary>
- /// <param name="min">The minimum version.</param>
- /// <param name="max">The maximum version.</param>
- /// <exception cref="FormatException">One of the specified versions is not a valid semantic version.</exception>
+ /// <inheritdoc />
public bool IsBetween(string min, string max)
{
return this.IsBetween(new SemanticVersion(min, allowNonStandard: true), new SemanticVersion(max, allowNonStandard: true));
}
- /// <summary>Get a string representation of the version.</summary>
+ /// <inheritdoc cref="ISemanticVersion.ToString" />
public override string ToString()
{
string version = $"{this.MajorVersion}.{this.MinorVersion}.{this.PatchVersion}";
@@ -187,7 +172,7 @@ namespace StardewModdingAPI.Toolkit
return version;
}
- /// <summary>Whether the version uses non-standard extensions, like four-part game versions on some platforms.</summary>
+ /// <inheritdoc />
public bool IsNonStandard()
{
return this.PlatformRelease != 0;
diff --git a/src/SMAPI/Framework/Content/AssetData.cs b/src/SMAPI/Framework/Content/AssetData.cs
index cacc6078..5c90d83b 100644
--- a/src/SMAPI/Framework/Content/AssetData.cs
+++ b/src/SMAPI/Framework/Content/AssetData.cs
@@ -16,7 +16,7 @@ namespace StardewModdingAPI.Framework.Content
/*********
** Accessors
*********/
- /// <summary>The content data being read.</summary>
+ /// <inheritdoc />
public TValue Data { get; protected set; }
@@ -36,10 +36,7 @@ namespace StardewModdingAPI.Framework.Content
this.OnDataReplaced = onDataReplaced;
}
- /// <summary>Replace the entire content value with the given value. This is generally not recommended, since it may break compatibility with other mods or different versions of the game.</summary>
- /// <param name="value">The new content value.</param>
- /// <exception cref="ArgumentNullException">The <paramref name="value"/> is null.</exception>
- /// <exception cref="InvalidCastException">The <paramref name="value"/>'s type is not compatible with the loaded asset's type.</exception>
+ /// <inheritdoc />
public void ReplaceWith(TValue value)
{
if (value == null)
diff --git a/src/SMAPI/Framework/Content/AssetDataForImage.cs b/src/SMAPI/Framework/Content/AssetDataForImage.cs
index 44a97136..5f91610e 100644
--- a/src/SMAPI/Framework/Content/AssetDataForImage.cs
+++ b/src/SMAPI/Framework/Content/AssetDataForImage.cs
@@ -28,13 +28,7 @@ namespace StardewModdingAPI.Framework.Content
public AssetDataForImage(string locale, string assetName, Texture2D data, Func<string, string> getNormalizedPath, Action<Texture2D> onDataReplaced)
: base(locale, assetName, data, getNormalizedPath, onDataReplaced) { }
- /// <summary>Overwrite part of the image.</summary>
- /// <param name="source">The image to patch into the content.</param>
- /// <param name="sourceArea">The part of the <paramref name="source"/> to copy (or <c>null</c> to take the whole texture). This must be within the bounds of the <paramref name="source"/> texture.</param>
- /// <param name="targetArea">The part of the content to patch (or <c>null</c> to patch the whole texture). The original content within this area will be erased. This must be within the bounds of the existing spritesheet.</param>
- /// <param name="patchMode">Indicates how an image should be patched.</param>
- /// <exception cref="ArgumentNullException">One of the arguments is null.</exception>
- /// <exception cref="ArgumentOutOfRangeException">The <paramref name="targetArea"/> is outside the bounds of the spritesheet.</exception>
+ /// <inheritdoc />
public void PatchImage(Texture2D source, Rectangle? sourceArea = null, Rectangle? targetArea = null, PatchMode patchMode = PatchMode.Replace)
{
// get texture
@@ -104,10 +98,7 @@ namespace StardewModdingAPI.Framework.Content
target.SetData(0, targetArea, sourceData, 0, pixelCount);
}
- /// <summary>Extend the image if needed to fit the given size. Note that this is an expensive operation, creates a new texture instance, and that extending a spritesheet horizontally may cause game errors or bugs.</summary>
- /// <param name="minWidth">The minimum texture width.</param>
- /// <param name="minHeight">The minimum texture height.</param>
- /// <returns>Whether the texture was resized.</returns>
+ /// <inheritdoc />
public bool ExtendImage(int minWidth, int minHeight)
{
if (this.Data.Width >= minWidth && this.Data.Height >= minHeight)
diff --git a/src/SMAPI/Framework/Content/AssetDataForMap.cs b/src/SMAPI/Framework/Content/AssetDataForMap.cs
index dee5b034..e80c6e53 100644
--- a/src/SMAPI/Framework/Content/AssetDataForMap.cs
+++ b/src/SMAPI/Framework/Content/AssetDataForMap.cs
@@ -24,10 +24,7 @@ namespace StardewModdingAPI.Framework.Content
public AssetDataForMap(string locale, string assetName, Map data, Func<string, string> getNormalizedPath, Action<Map> onDataReplaced)
: base(locale, assetName, data, getNormalizedPath, onDataReplaced) { }
- /// <summary>Copy layers, tiles, and tilesheets from another map onto the asset.</summary>
- /// <param name="source">The map from which to copy.</param>
- /// <param name="sourceArea">The tile area within the source map to copy, or <c>null</c> for the entire source map size. This must be within the bounds of the <paramref name="source"/> map.</param>
- /// <param name="targetArea">The tile area within the target map to overwrite, or <c>null</c> to patch the whole map. The original content within this area will be erased. This must be within the bounds of the existing map.</param>
+ /// <inheritdoc />
/// <remarks>Derived from <see cref="StardewValley.GameLocation.ApplyMapOverride"/> with a few changes:
/// - can be applied directly to the maps when loading, before the location is created;
/// - added support for source/target areas;
diff --git a/src/SMAPI/Framework/Content/AssetDataForObject.cs b/src/SMAPI/Framework/Content/AssetDataForObject.cs
index f00ba124..b7e8dfeb 100644
--- a/src/SMAPI/Framework/Content/AssetDataForObject.cs
+++ b/src/SMAPI/Framework/Content/AssetDataForObject.cs
@@ -26,32 +26,25 @@ namespace StardewModdingAPI.Framework.Content
public AssetDataForObject(IAssetInfo info, object data, Func<string, string> getNormalizedPath)
: this(info.Locale, info.AssetName, data, getNormalizedPath) { }
- /// <summary>Get a helper to manipulate the data as a dictionary.</summary>
- /// <typeparam name="TKey">The expected dictionary key.</typeparam>
- /// <typeparam name="TValue">The expected dictionary balue.</typeparam>
- /// <exception cref="InvalidOperationException">The content being read isn't a dictionary.</exception>
+ /// <inheritdoc />
public IAssetDataForDictionary<TKey, TValue> AsDictionary<TKey, TValue>()
{
return new AssetDataForDictionary<TKey, TValue>(this.Locale, this.AssetName, this.GetData<IDictionary<TKey, TValue>>(), this.GetNormalizedPath, this.ReplaceWith);
}
- /// <summary>Get a helper to manipulate the data as an image.</summary>
- /// <exception cref="InvalidOperationException">The content being read isn't an image.</exception>
+ /// <inheritdoc />
public IAssetDataForImage AsImage()
{
return new AssetDataForImage(this.Locale, this.AssetName, this.GetData<Texture2D>(), this.GetNormalizedPath, this.ReplaceWith);
}
- /// <summary>Get a helper to manipulate the data as a map.</summary>
- /// <exception cref="InvalidOperationException">The content being read isn't a map.</exception>
+ /// <inheritdoc />
public IAssetDataForMap AsMap()
{
return new AssetDataForMap(this.Locale, this.AssetName, this.GetData<Map>(), this.GetNormalizedPath, this.ReplaceWith);
}
- /// <summary>Get the data as a given type.</summary>
- /// <typeparam name="TData">The expected data type.</typeparam>
- /// <exception cref="InvalidCastException">The data can't be converted to <typeparamref name="TData"/>.</exception>
+ /// <inheritdoc />
public TData GetData<TData>()
{
if (!(this.Data is TData))
diff --git a/src/SMAPI/Framework/Content/AssetInfo.cs b/src/SMAPI/Framework/Content/AssetInfo.cs
index ed009499..d8106439 100644
--- a/src/SMAPI/Framework/Content/AssetInfo.cs
+++ b/src/SMAPI/Framework/Content/AssetInfo.cs
@@ -16,13 +16,13 @@ namespace StardewModdingAPI.Framework.Content
/*********
** Accessors
*********/
- /// <summary>The content's locale code, if the content is localized.</summary>
+ /// <inheritdoc />
public string Locale { get; }
- /// <summary>The normalized asset name being read. The format may change between platforms; see <see cref="AssetNameEquals"/> to compare with a known path.</summary>
+ /// <inheritdoc />
public string AssetName { get; }
- /// <summary>The content data type.</summary>
+ /// <inheritdoc />
public Type DataType { get; }
@@ -42,8 +42,7 @@ namespace StardewModdingAPI.Framework.Content
this.GetNormalizedPath = getNormalizedPath;
}
- /// <summary>Get whether the asset name being loaded matches a given name after normalization.</summary>
- /// <param name="path">The expected asset path, relative to the game's content folder and without the .xnb extension or locale suffix (like 'Data\ObjectInformation').</param>
+ /// <inheritdoc />
public bool AssetNameEquals(string path)
{
path = this.GetNormalizedPath(path);
diff --git a/src/SMAPI/Framework/ContentPack.cs b/src/SMAPI/Framework/ContentPack.cs
index 9c0bb9d1..43621141 100644
--- a/src/SMAPI/Framework/ContentPack.cs
+++ b/src/SMAPI/Framework/ContentPack.cs
@@ -24,13 +24,13 @@ namespace StardewModdingAPI.Framework
/*********
** Accessors
*********/
- /// <summary>The full path to the content pack's folder.</summary>
+ /// <inheritdoc />
public string DirectoryPath { get; }
- /// <summary>The content pack's manifest.</summary>
+ /// <inheritdoc />
public IManifest Manifest { get; }
- /// <summary>Provides translations stored in the content pack's <c>i18n</c> folder. See <see cref="IModHelper.Translation"/> for more info.</summary>
+ /// <inheritdoc />
public ITranslationHelper Translation { get; }
@@ -52,8 +52,7 @@ namespace StardewModdingAPI.Framework
this.JsonHelper = jsonHelper;
}
- /// <summary>Get whether a given file exists in the content pack.</summary>
- /// <param name="path">The file path to check.</param>
+ /// <inheritdoc />
public bool HasFile(string path)
{
this.AssertRelativePath(path, nameof(this.HasFile));
@@ -61,11 +60,7 @@ namespace StardewModdingAPI.Framework
return File.Exists(Path.Combine(this.DirectoryPath, path));
}
- /// <summary>Read a JSON file from the content pack folder.</summary>
- /// <typeparam name="TModel">The model type.</typeparam>
- /// <param name="path">The file path relative to the content directory.</param>
- /// <returns>Returns the deserialized model, or <c>null</c> if the file doesn't exist or is empty.</returns>
- /// <exception cref="InvalidOperationException">The <paramref name="path"/> is not relative or contains directory climbing (../).</exception>
+ /// <inheritdoc />
public TModel ReadJsonFile<TModel>(string path) where TModel : class
{
this.AssertRelativePath(path, nameof(this.ReadJsonFile));
@@ -76,11 +71,7 @@ namespace StardewModdingAPI.Framework
: null;
}
- /// <summary>Save data to a JSON file in the content pack's folder.</summary>
- /// <typeparam name="TModel">The model type. This should be a plain class that has public properties for the data you want. The properties can be complex types.</typeparam>
- /// <param name="path">The file path relative to the mod folder.</param>
- /// <param name="data">The arbitrary data to save.</param>
- /// <exception cref="InvalidOperationException">The <paramref name="path"/> is not relative or contains directory climbing (../).</exception>
+ /// <inheritdoc />
public void WriteJsonFile<TModel>(string path, TModel data) where TModel : class
{
this.AssertRelativePath(path, nameof(this.WriteJsonFile));
@@ -89,19 +80,13 @@ namespace StardewModdingAPI.Framework
this.JsonHelper.WriteJsonFile(path, data);
}
- /// <summary>Load content from the content pack folder (if not already cached), and return it. When loading a <c>.png</c> file, this must be called outside the game's draw loop.</summary>
- /// <typeparam name="T">The expected data type. The main supported types are <see cref="Map"/>, <see cref="Texture2D"/>, and dictionaries; other types may be supported by the game's content pipeline.</typeparam>
- /// <param name="key">The local path to a content file relative to the content pack folder.</param>
- /// <exception cref="ArgumentException">The <paramref name="key"/> is empty or contains invalid characters.</exception>
- /// <exception cref="ContentLoadException">The content asset couldn't be loaded (e.g. because it doesn't exist).</exception>
+ /// <inheritdoc />
public T LoadAsset<T>(string key)
{
return this.Content.Load<T>(key, ContentSource.ModFolder);
}
- /// <summary>Get the underlying key in the game's content cache for an asset. This can be used to load custom map tilesheets, but should be avoided when you can use the content API instead. This does not validate whether the asset exists.</summary>
- /// <param name="key">The the local path to a content file relative to the content pack folder.</param>
- /// <exception cref="ArgumentException">The <paramref name="key"/> is empty or contains invalid characters.</exception>
+ /// <inheritdoc />
public string GetActualAssetKey(string key)
{
return this.Content.GetActualAssetKey(key, ContentSource.ModFolder);
diff --git a/src/SMAPI/Framework/CursorPosition.cs b/src/SMAPI/Framework/CursorPosition.cs
index 2008ccce..80d89994 100644
--- a/src/SMAPI/Framework/CursorPosition.cs
+++ b/src/SMAPI/Framework/CursorPosition.cs
@@ -8,16 +8,16 @@ namespace StardewModdingAPI.Framework
/*********
** Accessors
*********/
- /// <summary>The pixel position relative to the top-left corner of the in-game map, adjusted for pixel zoom.</summary>
+ /// <inheritdoc />
public Vector2 AbsolutePixels { get; }
- /// <summary>The pixel position relative to the top-left corner of the visible screen, adjusted for pixel zoom.</summary>
+ /// <inheritdoc />
public Vector2 ScreenPixels { get; }
- /// <summary>The tile position under the cursor relative to the top-left corner of the map.</summary>
+ /// <inheritdoc />
public Vector2 Tile { get; }
- /// <summary>The tile position that the game considers under the cursor for purposes of clicking actions. This may be different than <see cref="Tile"/> if that's too far from the player.</summary>
+ /// <inheritdoc />
public Vector2 GrabTile { get; }
@@ -37,8 +37,7 @@ namespace StardewModdingAPI.Framework
this.GrabTile = grabTile;
}
- /// <summary>Get whether the current object is equal to another object of the same type.</summary>
- /// <param name="other">An object to compare with this object.</param>
+ /// <inheritdoc />
public bool Equals(ICursorPosition other)
{
return other != null && this.AbsolutePixels == other.AbsolutePixels;
diff --git a/src/SMAPI/Framework/GameVersion.cs b/src/SMAPI/Framework/GameVersion.cs
index 3ed60920..b69c6757 100644
--- a/src/SMAPI/Framework/GameVersion.cs
+++ b/src/SMAPI/Framework/GameVersion.cs
@@ -38,7 +38,7 @@ namespace StardewModdingAPI.Framework
public GameVersion(string version)
: base(GameVersion.GetSemanticVersionString(version), allowNonStandard: true) { }
- /// <summary>Get a string representation of the version.</summary>
+ /// <inheritdoc />
public override string ToString()
{
return GameVersion.GetGameVersionString(base.ToString());
diff --git a/src/SMAPI/Framework/ModHelpers/BaseHelper.cs b/src/SMAPI/Framework/ModHelpers/BaseHelper.cs
index 16032da1..5a3d4bed 100644
--- a/src/SMAPI/Framework/ModHelpers/BaseHelper.cs
+++ b/src/SMAPI/Framework/ModHelpers/BaseHelper.cs
@@ -1,4 +1,4 @@
-namespace StardewModdingAPI.Framework.ModHelpers
+namespace StardewModdingAPI.Framework.ModHelpers
{
/// <summary>The common base class for mod helpers.</summary>
internal abstract class BaseHelper : IModLinked
@@ -6,7 +6,7 @@
/*********
** Accessors
*********/
- /// <summary>The unique ID of the mod for which the helper was created.</summary>
+ /// <inheritdoc />
public string ModID { get; }
diff --git a/src/SMAPI/Framework/ModHelpers/CommandHelper.cs b/src/SMAPI/Framework/ModHelpers/CommandHelper.cs
index e9d53d84..600f867f 100644
--- a/src/SMAPI/Framework/ModHelpers/CommandHelper.cs
+++ b/src/SMAPI/Framework/ModHelpers/CommandHelper.cs
@@ -28,23 +28,14 @@ namespace StardewModdingAPI.Framework.ModHelpers
this.CommandManager = commandManager;
}
- /// <summary>Add a console command.</summary>
- /// <param name="name">The command name, which the user must type to trigger it.</param>
- /// <param name="documentation">The human-readable documentation shown when the player runs the built-in 'help' command.</param>
- /// <param name="callback">The method to invoke when the command is triggered. This method is passed the command name and arguments submitted by the user.</param>
- /// <exception cref="ArgumentNullException">The <paramref name="name"/> or <paramref name="callback"/> is null or empty.</exception>
- /// <exception cref="FormatException">The <paramref name="name"/> is not a valid format.</exception>
- /// <exception cref="ArgumentException">There's already a command with that name.</exception>
+ /// <inheritdoc />
public ICommandHelper Add(string name, string documentation, Action<string, string[]> callback)
{
this.CommandManager.Add(this.Mod, name, documentation, callback);
return this;
}
- /// <summary>Trigger a command.</summary>
- /// <param name="name">The command name.</param>
- /// <param name="arguments">The command arguments.</param>
- /// <returns>Returns whether a matching command was triggered.</returns>
+ /// <inheritdoc />
public bool Trigger(string name, string[] arguments)
{
return this.CommandManager.Trigger(name, arguments);
diff --git a/src/SMAPI/Framework/ModHelpers/ContentHelper.cs b/src/SMAPI/Framework/ModHelpers/ContentHelper.cs
index 23e45fd1..80f61c13 100644
--- a/src/SMAPI/Framework/ModHelpers/ContentHelper.cs
+++ b/src/SMAPI/Framework/ModHelpers/ContentHelper.cs
@@ -40,10 +40,10 @@ namespace StardewModdingAPI.Framework.ModHelpers
/*********
** Accessors
*********/
- /// <summary>The game's current locale code (like <c>pt-BR</c>).</summary>
+ /// <inheritdoc />
public string CurrentLocale => this.GameContentManager.GetLocale();
- /// <summary>The game's current locale as an enum value.</summary>
+ /// <inheritdoc />
public LocalizedContentManager.LanguageCode CurrentLocaleConstant => this.GameContentManager.Language;
/// <summary>The observable implementation of <see cref="AssetEditors"/>.</summary>
@@ -52,10 +52,10 @@ namespace StardewModdingAPI.Framework.ModHelpers
/// <summary>The observable implementation of <see cref="AssetLoaders"/>.</summary>
internal ObservableCollection<IAssetLoader> ObservableAssetLoaders { get; } = new ObservableCollection<IAssetLoader>();
- /// <summary>Interceptors which provide the initial versions of matching content assets.</summary>
+ /// <inheritdoc />
public IList<IAssetLoader> AssetLoaders => this.ObservableAssetLoaders;
- /// <summary>Interceptors which edit matching content assets after they're loaded.</summary>
+ /// <inheritdoc />
public IList<IAssetEditor> AssetEditors => this.ObservableAssetEditors;
@@ -80,12 +80,7 @@ namespace StardewModdingAPI.Framework.ModHelpers
this.Monitor = monitor;
}
- /// <summary>Load content from the game folder or mod folder (if not already cached), and return it. When loading a <c>.png</c> file, this must be called outside the game's draw loop.</summary>
- /// <typeparam name="T">The expected data type. The main supported types are <see cref="Map"/>, <see cref="Texture2D"/>, and dictionaries; other types may be supported by the game's content pipeline.</typeparam>
- /// <param name="key">The asset key to fetch (if the <paramref name="source"/> is <see cref="ContentSource.GameContent"/>), or the local path to a content file relative to the mod folder.</param>
- /// <param name="source">Where to search for a matching content asset.</param>
- /// <exception cref="ArgumentException">The <paramref name="key"/> is empty or contains invalid characters.</exception>
- /// <exception cref="ContentLoadException">The content asset couldn't be loaded (e.g. because it doesn't exist).</exception>
+ /// <inheritdoc />
public T Load<T>(string key, ContentSource source = ContentSource.ModFolder)
{
try
@@ -109,18 +104,14 @@ namespace StardewModdingAPI.Framework.ModHelpers
}
}
- /// <summary>Normalize an asset name so it's consistent with those generated by the game. This is mainly useful for string comparisons like <see cref="string.StartsWith(string)"/> on generated asset names, and isn't necessary when passing asset names into other content helper methods.</summary>
- /// <param name="assetName">The asset key.</param>
+ /// <inheritdoc />
[Pure]
public string NormalizeAssetName(string assetName)
{
return this.ModContentManager.AssertAndNormalizeAssetName(assetName);
}
- /// <summary>Get the underlying key in the game's content cache for an asset. This can be used to load custom map tilesheets, but should be avoided when you can use the content API instead. This does not validate whether the asset exists.</summary>
- /// <param name="key">The asset key to fetch (if the <paramref name="source"/> is <see cref="ContentSource.GameContent"/>), or the local path to a content file relative to the mod folder.</param>
- /// <param name="source">Where to search for a matching content asset.</param>
- /// <exception cref="ArgumentException">The <paramref name="key"/> is empty or contains invalid characters.</exception>
+ /// <inheritdoc />
public string GetActualAssetKey(string key, ContentSource source = ContentSource.ModFolder)
{
switch (source)
@@ -136,10 +127,7 @@ namespace StardewModdingAPI.Framework.ModHelpers
}
}
- /// <summary>Remove an asset from the content cache so it's reloaded on the next request. This will reload core game assets if needed, but references to the former asset will still show the previous content.</summary>
- /// <param name="key">The asset key to invalidate in the content folder.</param>
- /// <exception cref="ArgumentException">The <paramref name="key"/> is empty or contains invalid characters.</exception>
- /// <returns>Returns whether the given asset key was cached.</returns>
+ /// <inheritdoc />
public bool InvalidateCache(string key)
{
string actualKey = this.GetActualAssetKey(key, ContentSource.GameContent);