From 828be405e11dd8bc7f8a3692d2c74517734f67a5 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 30 Aug 2020 22:53:19 -0400 Subject: use inheritdoc --- src/SMAPI/Framework/Content/AssetData.cs | 7 ++----- src/SMAPI/Framework/Content/AssetDataForImage.cs | 13 ++----------- src/SMAPI/Framework/Content/AssetDataForMap.cs | 5 +---- src/SMAPI/Framework/Content/AssetDataForObject.cs | 15 ++++----------- src/SMAPI/Framework/Content/AssetInfo.cs | 9 ++++----- 5 files changed, 13 insertions(+), 36 deletions(-) (limited to 'src/SMAPI/Framework/Content') 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 *********/ - /// The content data being read. + /// public TValue Data { get; protected set; } @@ -36,10 +36,7 @@ namespace StardewModdingAPI.Framework.Content this.OnDataReplaced = onDataReplaced; } - /// 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. - /// The new content value. - /// The is null. - /// The 's type is not compatible with the loaded asset's type. + /// 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 getNormalizedPath, Action onDataReplaced) : base(locale, assetName, data, getNormalizedPath, onDataReplaced) { } - /// Overwrite part of the image. - /// The image to patch into the content. - /// The part of the to copy (or null to take the whole texture). This must be within the bounds of the texture. - /// The part of the content to patch (or null to patch the whole texture). The original content within this area will be erased. This must be within the bounds of the existing spritesheet. - /// Indicates how an image should be patched. - /// One of the arguments is null. - /// The is outside the bounds of the spritesheet. + /// 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); } - /// 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. - /// The minimum texture width. - /// The minimum texture height. - /// Whether the texture was resized. + /// 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 getNormalizedPath, Action onDataReplaced) : base(locale, assetName, data, getNormalizedPath, onDataReplaced) { } - /// Copy layers, tiles, and tilesheets from another map onto the asset. - /// The map from which to copy. - /// The tile area within the source map to copy, or null for the entire source map size. This must be within the bounds of the map. - /// The tile area within the target map to overwrite, or null to patch the whole map. The original content within this area will be erased. This must be within the bounds of the existing map. + /// /// Derived from 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 getNormalizedPath) : this(info.Locale, info.AssetName, data, getNormalizedPath) { } - /// Get a helper to manipulate the data as a dictionary. - /// The expected dictionary key. - /// The expected dictionary balue. - /// The content being read isn't a dictionary. + /// public IAssetDataForDictionary AsDictionary() { return new AssetDataForDictionary(this.Locale, this.AssetName, this.GetData>(), this.GetNormalizedPath, this.ReplaceWith); } - /// Get a helper to manipulate the data as an image. - /// The content being read isn't an image. + /// public IAssetDataForImage AsImage() { return new AssetDataForImage(this.Locale, this.AssetName, this.GetData(), this.GetNormalizedPath, this.ReplaceWith); } - /// Get a helper to manipulate the data as a map. - /// The content being read isn't a map. + /// public IAssetDataForMap AsMap() { return new AssetDataForMap(this.Locale, this.AssetName, this.GetData(), this.GetNormalizedPath, this.ReplaceWith); } - /// Get the data as a given type. - /// The expected data type. - /// The data can't be converted to . + /// public TData GetData() { 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 *********/ - /// The content's locale code, if the content is localized. + /// public string Locale { get; } - /// The normalized asset name being read. The format may change between platforms; see to compare with a known path. + /// public string AssetName { get; } - /// The content data type. + /// public Type DataType { get; } @@ -42,8 +42,7 @@ namespace StardewModdingAPI.Framework.Content this.GetNormalizedPath = getNormalizedPath; } - /// Get whether the asset name being loaded matches a given name after normalization. - /// The expected asset path, relative to the game's content folder and without the .xnb extension or locale suffix (like 'Data\ObjectInformation'). + /// public bool AssetNameEquals(string path) { path = this.GetNormalizedPath(path); -- cgit