summaryrefslogtreecommitdiff
path: root/src/SMAPI/Events/AssetsInvalidatedEventArgs.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-05-01 18:16:09 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-05-01 18:16:09 -0400
commitc8ad50dad1d706a1901798f9396f6becfea36c0e (patch)
tree28bd818a5db39ec5ece1bd141a28de955950463b /src/SMAPI/Events/AssetsInvalidatedEventArgs.cs
parent451b70953ff4c0b1b27ae0de203ad99379b45b2a (diff)
parentf78093bdb58d477b400cde3f19b70ffd6ddf833d (diff)
downloadSMAPI-c8ad50dad1d706a1901798f9396f6becfea36c0e.tar.gz
SMAPI-c8ad50dad1d706a1901798f9396f6becfea36c0e.tar.bz2
SMAPI-c8ad50dad1d706a1901798f9396f6becfea36c0e.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Events/AssetsInvalidatedEventArgs.cs')
-rw-r--r--src/SMAPI/Events/AssetsInvalidatedEventArgs.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/SMAPI/Events/AssetsInvalidatedEventArgs.cs b/src/SMAPI/Events/AssetsInvalidatedEventArgs.cs
new file mode 100644
index 00000000..614cdf49
--- /dev/null
+++ b/src/SMAPI/Events/AssetsInvalidatedEventArgs.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.Immutable;
+
+namespace StardewModdingAPI.Events
+{
+ /// <summary>Event arguments for an <see cref="IContentEvents.AssetsInvalidated"/> event.</summary>
+ public class AssetsInvalidatedEventArgs : EventArgs
+ {
+ /*********
+ ** Accessors
+ *********/
+ /// <summary>The asset names that were invalidated.</summary>
+ public IReadOnlySet<IAssetName> Names { get; }
+
+ /// <summary>The <see cref="Names"/> with any locale codes stripped.</summary>
+ /// <remarks>For example, if <see cref="Names"/> contains a locale like <c>Data/Bundles.fr-FR</c>, this will have the name without locale like <c>Data/Bundles</c>. If the name has no locale, this field is equivalent.</remarks>
+ public IReadOnlySet<IAssetName> NamesWithoutLocale { get; }
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// <summary>Construct an instance.</summary>
+ /// <param name="names">The asset names that were invalidated.</param>
+ /// <param name="namesWithoutLocale">The <paramref name="names"/> with any locale codes stripped.</param>
+ internal AssetsInvalidatedEventArgs(IEnumerable<IAssetName> names, IEnumerable<IAssetName> namesWithoutLocale)
+ {
+ this.Names = names.ToImmutableHashSet();
+ this.NamesWithoutLocale = namesWithoutLocale.ToImmutableHashSet();
+ }
+ }
+}