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/ContentPack.cs | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) (limited to 'src/SMAPI/Framework/ContentPack.cs') 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 *********/ - /// The full path to the content pack's folder. + /// public string DirectoryPath { get; } - /// The content pack's manifest. + /// public IManifest Manifest { get; } - /// Provides translations stored in the content pack's i18n folder. See for more info. + /// public ITranslationHelper Translation { get; } @@ -52,8 +52,7 @@ namespace StardewModdingAPI.Framework this.JsonHelper = jsonHelper; } - /// Get whether a given file exists in the content pack. - /// The file path to check. + /// 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)); } - /// Read a JSON file from the content pack folder. - /// The model type. - /// The file path relative to the content directory. - /// Returns the deserialized model, or null if the file doesn't exist or is empty. - /// The is not relative or contains directory climbing (../). + /// public TModel ReadJsonFile(string path) where TModel : class { this.AssertRelativePath(path, nameof(this.ReadJsonFile)); @@ -76,11 +71,7 @@ namespace StardewModdingAPI.Framework : null; } - /// Save data to a JSON file in the content pack's folder. - /// The model type. This should be a plain class that has public properties for the data you want. The properties can be complex types. - /// The file path relative to the mod folder. - /// The arbitrary data to save. - /// The is not relative or contains directory climbing (../). + /// public void WriteJsonFile(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); } - /// Load content from the content pack folder (if not already cached), and return it. When loading a .png file, this must be called outside the game's draw loop. - /// The expected data type. The main supported types are , , and dictionaries; other types may be supported by the game's content pipeline. - /// The local path to a content file relative to the content pack folder. - /// The is empty or contains invalid characters. - /// The content asset couldn't be loaded (e.g. because it doesn't exist). + /// public T LoadAsset(string key) { return this.Content.Load(key, ContentSource.ModFolder); } - /// 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. - /// The the local path to a content file relative to the content pack folder. - /// The is empty or contains invalid characters. + /// public string GetActualAssetKey(string key) { return this.Content.GetActualAssetKey(key, ContentSource.ModFolder); -- cgit