summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/StateTracking/IWatcher.cs
blob: 4a0e399880304f25885d36b82da3f2d587b96cc8 (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
using System;

namespace StardewModdingAPI.Framework.StateTracking
{
    /// <summary>A watcher which detects changes to something.</summary>
    internal interface IWatcher : IDisposable
    {
        /*********
        ** Accessors
        *********/
        /// <summary>A name which identifies what the watcher is watching, used for troubleshooting.</summary>
        string Name { get; }

        /// <summary>Whether the value changed since the last reset.</summary>
        bool IsChanged { get; }


        /*********
        ** Methods
        *********/
        /// <summary>Update the current value if needed.</summary>
        void Update();

        /// <summary>Set the current value as the baseline.</summary>
        void Reset();
    }
}