mirror of
https://github.com/Pathoschild/SMAPI.git
synced 2026-10-12 02:08:51 +00:00
migrate to new field keyword
This commit is contained in:
@@ -10,13 +10,6 @@ namespace StardewModdingAPI.Toolkit.Framework.ModScanning;
|
||||
/// <summary>The info about a mod read from its folder.</summary>
|
||||
public class ModFolder
|
||||
{
|
||||
/*********
|
||||
** Fields
|
||||
*********/
|
||||
/// <summary>The backing field for <see cref="Directory"/>.</summary>
|
||||
private DirectoryInfo? DirectoryImpl;
|
||||
|
||||
|
||||
/*********
|
||||
** Accessors
|
||||
*********/
|
||||
@@ -28,7 +21,7 @@ public class ModFolder
|
||||
|
||||
/// <summary>The folder containing the mod's manifest.json.</summary>
|
||||
[JsonIgnore]
|
||||
public DirectoryInfo Directory => this.DirectoryImpl ??= new DirectoryInfo(this.DirectoryPath);
|
||||
public DirectoryInfo Directory => field ??= new DirectoryInfo(this.DirectoryPath);
|
||||
|
||||
/// <summary>The mod type.</summary>
|
||||
public ModType Type { get; }
|
||||
@@ -64,7 +57,7 @@ public class ModFolder
|
||||
public ModFolder(DirectoryInfo root, DirectoryInfo directory, ModType type, Manifest? manifest, ModParseError manifestParseError, string? manifestParseErrorText)
|
||||
{
|
||||
// save info
|
||||
this.DirectoryImpl = directory;
|
||||
this.Directory = directory;
|
||||
this.DirectoryPath = directory.FullName;
|
||||
this.Type = type;
|
||||
this.Manifest = manifest;
|
||||
|
||||
@@ -12,9 +12,6 @@ internal class AssetInfo : IAssetInfo
|
||||
/// <summary>Normalizes an asset key to match the cache key.</summary>
|
||||
protected readonly Func<string, string> GetNormalizedPath;
|
||||
|
||||
/// <summary>The backing field for <see cref="NameWithoutLocale"/>.</summary>
|
||||
private IAssetName? NameWithoutLocaleImpl;
|
||||
|
||||
|
||||
/*********
|
||||
** Accessors
|
||||
@@ -26,7 +23,7 @@ internal class AssetInfo : IAssetInfo
|
||||
public IAssetName Name { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public IAssetName NameWithoutLocale => this.NameWithoutLocaleImpl ??= this.Name.GetBaseAssetName();
|
||||
public IAssetName NameWithoutLocale => field ??= this.Name.GetBaseAssetName();
|
||||
|
||||
/// <inheritdoc />
|
||||
public Type DataType { get; }
|
||||
|
||||
Reference in New Issue
Block a user