diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-08-01 11:07:29 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-08-01 11:07:29 -0400 |
commit | 60b41195778af33fd609eab66d9ae3f1d1165e8f (patch) | |
tree | 7128b906d40e94c56c34ed6058f27bc31c31a08b /src/SMAPI/Events/EventArgsLocationObjectsChanged.cs | |
parent | b9bc1a6d17cafa0a97b46ffecda432cfc2f23b51 (diff) | |
parent | 52cf953f685c65b2b6814e375ec9a5ffa03c440a (diff) | |
download | SMAPI-60b41195778af33fd609eab66d9ae3f1d1165e8f.tar.gz SMAPI-60b41195778af33fd609eab66d9ae3f1d1165e8f.tar.bz2 SMAPI-60b41195778af33fd609eab66d9ae3f1d1165e8f.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Events/EventArgsLocationObjectsChanged.cs')
-rw-r--r-- | src/SMAPI/Events/EventArgsLocationObjectsChanged.cs | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs b/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs index 180e9d78..3bb387d5 100644 --- a/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs +++ b/src/SMAPI/Events/EventArgsLocationObjectsChanged.cs @@ -1,43 +1,40 @@ using System; -using Microsoft.Xna.Framework; -#if STARDEW_VALLEY_1_3 using System.Collections.Generic; -using Netcode; -#else +using System.Linq; +using Microsoft.Xna.Framework; using StardewValley; -#endif -using Object = StardewValley.Object; +using SObject = StardewValley.Object; namespace StardewModdingAPI.Events { - /// <summary>Event arguments for a <see cref="LocationEvents.LocationObjectsChanged"/> event.</summary> + /// <summary>Event arguments for a <see cref="LocationEvents.ObjectsChanged"/> event.</summary> public class EventArgsLocationObjectsChanged : EventArgs { /********* ** Accessors *********/ - /// <summary>The current list of objects in the current location.</summary> -#if STARDEW_VALLEY_1_3 - public IDictionary<Vector2, NetRef<Object>> NewObjects { get; } -#else - public SerializableDictionary<Vector2, Object> NewObjects { get; } -#endif + /// <summary>The location which changed.</summary> + public GameLocation Location { get; } + + /// <summary>The objects added to the location.</summary> + public IEnumerable<KeyValuePair<Vector2, SObject>> Added { get; } + + /// <summary>The objects removed from the location.</summary> + public IEnumerable<KeyValuePair<Vector2, SObject>> Removed { get; } /********* ** Public methods *********/ /// <summary>Construct an instance.</summary> - /// <param name="newObjects">The current list of objects in the current location.</param> - public EventArgsLocationObjectsChanged( -#if STARDEW_VALLEY_1_3 - IDictionary<Vector2, NetRef<Object>> newObjects -#else - SerializableDictionary<Vector2, Object> newObjects -#endif - ) + /// <param name="location">The location which changed.</param> + /// <param name="added">The objects added to the location.</param> + /// <param name="removed">The objects removed from the location.</param> + public EventArgsLocationObjectsChanged(GameLocation location, IEnumerable<KeyValuePair<Vector2, SObject>> added, IEnumerable<KeyValuePair<Vector2, SObject>> removed) { - this.NewObjects = newObjects; + this.Location = location; + this.Added = added.ToArray(); + this.Removed = removed.ToArray(); } } } |