diff options
Diffstat (limited to 'src/SMAPI/Events/BuildingListChangedEventArgs.cs')
-rw-r--r-- | src/SMAPI/Events/BuildingListChangedEventArgs.cs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/SMAPI/Events/BuildingListChangedEventArgs.cs b/src/SMAPI/Events/BuildingListChangedEventArgs.cs new file mode 100644 index 00000000..9bc691fc --- /dev/null +++ b/src/SMAPI/Events/BuildingListChangedEventArgs.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using StardewValley; +using StardewValley.Buildings; + +namespace StardewModdingAPI.Events +{ + /// <summary>Event arguments for a <see cref="IWorldEvents.BuildingListChanged"/> event.</summary> + public class BuildingListChangedEventArgs : EventArgs + { + /********* + ** Accessors + *********/ + /// <summary>The location which changed.</summary> + public GameLocation Location { get; } + + /// <summary>The buildings added to the location.</summary> + public IEnumerable<Building> Added { get; } + + /// <summary>The buildings removed from the location.</summary> + public IEnumerable<Building> Removed { get; } + + + /********* + ** Public methods + *********/ + /// <summary>Construct an instance.</summary> + /// <param name="location">The location which changed.</param> + /// <param name="added">The buildings added to the location.</param> + /// <param name="removed">The buildings removed from the location.</param> + public BuildingListChangedEventArgs(GameLocation location, IEnumerable<Building> added, IEnumerable<Building> removed) + { + this.Location = location; + this.Added = added.ToArray(); + this.Removed = removed.ToArray(); + } + } +} |