summaryrefslogtreecommitdiff
path: root/src/SMAPI.Toolkit/Framework/Clients/Wiki/WikiDataOverrideEntry.cs
blob: e5ee81be2633b305b58c3f023559332b8b07ace0 (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
#nullable enable

using System;

namespace StardewModdingAPI.Toolkit.Framework.Clients.Wiki
{
    /// <summary>The data overrides to apply to matching mods.</summary>
    public class WikiDataOverrideEntry
    {
        /*********
        ** Accessors
        *********/
        /// <summary>The unique mod IDs for the mods to override.</summary>
        public string[] Ids { get; set; } = Array.Empty<string>();

        /// <summary>Maps local versions to a semantic version for update checks.</summary>
        public ChangeDescriptor? ChangeLocalVersions { get; set; }

        /// <summary>Maps remote versions to a semantic version for update checks.</summary>
        public ChangeDescriptor? ChangeRemoteVersions { get; set; }

        /// <summary>Update keys to add (optionally prefixed by '+'), remove (prefixed by '-'), or replace.</summary>
        public ChangeDescriptor? ChangeUpdateKeys { get; set; }

        /// <summary>Whether the entry has any changes.</summary>
        public bool HasChanges =>
            this.ChangeLocalVersions?.HasChanges == true
            || this.ChangeRemoteVersions?.HasChanges == true
            || this.ChangeUpdateKeys?.HasChanges == true;
    }
}