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; } /// Whether to log a stack trace showing where the deprecated code is in the mod. public bool LogStackTrace { 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. /// Whether to log a stack trace showing where the deprecated code is in the mod. public DeprecationWarning(IModMetadata? mod, string nounPhrase, string version, DeprecationLevel level, ImmutableStackTrace stackTrace, bool logStackTrace) { this.Mod = mod; this.NounPhrase = nounPhrase; this.Version = version; this.Level = level; this.StackTrace = stackTrace; this.LogStackTrace = logStackTrace; } } }