diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-08-30 22:53:19 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-08-30 22:53:19 -0400 |
commit | 828be405e11dd8bc7f8a3692d2c74517734f67a5 (patch) | |
tree | 0a85e065e7b5604b4c1d0a1b24a53a9f85f550e5 /src/SMAPI/Framework/Content | |
parent | 3a4606164c6ce8d900077b567dc1142f6aad0f4c (diff) | |
download | SMAPI-828be405e11dd8bc7f8a3692d2c74517734f67a5.tar.gz SMAPI-828be405e11dd8bc7f8a3692d2c74517734f67a5.tar.bz2 SMAPI-828be405e11dd8bc7f8a3692d2c74517734f67a5.zip |
use inheritdoc
Diffstat (limited to 'src/SMAPI/Framework/Content')
-rw-r--r-- | src/SMAPI/Framework/Content/AssetData.cs | 7 | ||||
-rw-r--r-- | src/SMAPI/Framework/Content/AssetDataForImage.cs | 13 | ||||
-rw-r--r-- | src/SMAPI/Framework/Content/AssetDataForMap.cs | 5 | ||||
-rw-r--r-- | src/SMAPI/Framework/Content/AssetDataForObject.cs | 15 | ||||
-rw-r--r-- | src/SMAPI/Framework/Content/AssetInfo.cs | 9 |
5 files changed, 13 insertions, 36 deletions
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); |