summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/Events/ModWorldEvents.cs
blob: 614945c78516d7bd44d2897fafdc0e86d95bc415 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#nullable disable

using System;
using StardewModdingAPI.Events;

namespace StardewModdingAPI.Framework.Events
{
    /// <inheritdoc cref="IWorldEvents" />
    internal class ModWorldEvents : ModEventsBase, IWorldEvents
    {
        /*********
        ** Accessors
        *********/
        /// <inheritdoc />
        public event EventHandler<LocationListChangedEventArgs> LocationListChanged
        {
            add => this.EventManager.LocationListChanged.Add(value, this.Mod);
            remove => this.EventManager.LocationListChanged.Remove(value);
        }

        /// <inheritdoc />
        public event EventHandler<BuildingListChangedEventArgs> BuildingListChanged
        {
            add => this.EventManager.BuildingListChanged.Add(value, this.Mod);
            remove => this.EventManager.BuildingListChanged.Remove(value);
        }

        /// <inheritdoc />
        public event EventHandler<DebrisListChangedEventArgs> DebrisListChanged
        {
            add => this.EventManager.DebrisListChanged.Add(value, this.Mod);
            remove => this.EventManager.DebrisListChanged.Remove(value);
        }

        /// <inheritdoc />
        public event EventHandler<LargeTerrainFeatureListChangedEventArgs> LargeTerrainFeatureListChanged
        {
            add => this.EventManager.LargeTerrainFeatureListChanged.Add(value, this.Mod);
            remove => this.EventManager.LargeTerrainFeatureListChanged.Remove(value);
        }

        /// <inheritdoc />
        public event EventHandler<NpcListChangedEventArgs> NpcListChanged
        {
            add => this.EventManager.NpcListChanged.Add(value, this.Mod);
            remove => this.EventManager.NpcListChanged.Remove(value);
        }

        /// <inheritdoc />
        public event EventHandler<ObjectListChangedEventArgs> ObjectListChanged
        {
            add => this.EventManager.ObjectListChanged.Add(value, this.Mod);
            remove => this.EventManager.ObjectListChanged.Remove(value);
        }

        /// <inheritdoc />
        public event EventHandler<ChestInventoryChangedEventArgs> ChestInventoryChanged
        {
            add => this.EventManager.ChestInventoryChanged.Add(value, this.Mod);
            remove => this.EventManager.ChestInventoryChanged.Remove(value);
        }

        /// <inheritdoc />
        public event EventHandler<TerrainFeatureListChangedEventArgs> TerrainFeatureListChanged
        {
            add => this.EventManager.TerrainFeatureListChanged.Add(value, this.Mod);
            remove => this.EventManager.TerrainFeatureListChanged.Remove(value);
        }

        /// <inheritdoc />
        public event EventHandler<FurnitureListChangedEventArgs> FurnitureListChanged
        {
            add => this.EventManager.FurnitureListChanged.Add(value, this.Mod);
            remove => this.EventManager.FurnitureListChanged.Remove(value);
        }


        /*********
        ** Public methods
        *********/
        /// <summary>Construct an instance.</summary>
        /// <param name="mod">The mod which uses this instance.</param>
        /// <param name="eventManager">The underlying event manager.</param>
        internal ModWorldEvents(IModMetadata mod, EventManager eventManager)
            : base(mod, eventManager) { }
    }
}