summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/Events/ModGameLoopEvents.cs
blob: 5f0db369c4f1a57bd5a8e4f71043245b7271331a (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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
using System;
using StardewModdingAPI.Events;

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

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

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

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

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

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

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

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

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

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

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

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

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

        /// <inheritdoc />
        public event EventHandler<ReturnedToTitleEventArgs> ReturnedToTitle
        {
            add => this.EventManager.ReturnedToTitle.Add(value, this.Mod);
            remove => this.EventManager.ReturnedToTitle.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 ModGameLoopEvents(IModMetadata mod, EventManager eventManager)
            : base(mod, eventManager) { }
    }
}