summaryrefslogtreecommitdiff
path: root/src/SMAPI/Events/WorldBuildingsChangedEventArgs.cs
blob: 1f68fd02f380963a4779d3425d8e539d61249f5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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.BuildingsChanged"/> event.</summary>
    public class WorldBuildingsChangedEventArgs : 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 WorldBuildingsChangedEventArgs(GameLocation location, IEnumerable<Building> added, IEnumerable<Building> removed)
        {
            this.Location = location;
            this.Added = added.ToArray();
            this.Removed = removed.ToArray();
        }
    }
}