using System.Diagnostics;
namespace StardewModdingAPI.Framework.Deprecations
{
/// A deprecation warning for a mod.
internal class DeprecationWarning
{
/*********
** Accessors
*********/
/// The affected mod.
public IModMetadata? Mod { get; }
/// Get the display name for the affected mod.
public string ModName => this.Mod?.DisplayName ?? "";
/// A noun phrase describing what is deprecated.
public string NounPhrase { get; }
/// The SMAPI version which deprecated it.
public string Version { get; }
/// The deprecation level for the affected code.
public DeprecationLevel Level { get; }
/// The stack trace when the deprecation warning was raised.
public ImmutableStackTrace StackTrace { get; }
/*********
** Public methods
*********/
/// Construct an instance.
/// The affected mod.
/// A noun phrase describing what is deprecated.
/// The SMAPI version which deprecated it.
/// The deprecation level for the affected code.
/// The stack trace when the deprecation warning was raised.
public DeprecationWarning(IModMetadata? mod, string nounPhrase, string version, DeprecationLevel level, ImmutableStackTrace stackTrace)
{
this.Mod = mod;
this.NounPhrase = nounPhrase;
this.Version = version;
this.Level = level;
this.StackTrace = stackTrace;
}
}
}