forked from Pathoschild/StardewMods
-
Notifications
You must be signed in to change notification settings - Fork 0
/
IContentPatcherAPI.cs
26 lines (24 loc) · 1.77 KB
/
IContentPatcherAPI.cs
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
using System;
using System.Collections.Generic;
using ContentPatcher.Framework.Tokens.ValueProviders.ModConvention;
using StardewModdingAPI;
namespace ContentPatcher
{
/// <summary>The Content Patcher API which other mods can access.</summary>
public interface IContentPatcherAPI
{
/*********
** Methods
*********/
/// <summary>Register a simple token.</summary>
/// <param name="mod">The manifest of the mod defining the token (see <see cref="Mod.ModManifest"/> on your entry class).</param>
/// <param name="name">The token name. This only needs to be unique for your mod; Content Patcher will prefix it with your mod ID automatically, like <c>YourName.ExampleMod/SomeTokenName</c>.</param>
/// <param name="getValue">A function which returns the current token value. If this returns a null or empty list, the token is considered unavailable in the current context and any patches or dynamic tokens using it are disabled.</param>
void RegisterToken(IManifest mod, string name, Func<IEnumerable<string>> getValue);
/// <summary>Register a complex token. This is an advanced API; only use this method if you've read the documentation and are aware of the consequences.</summary>
/// <param name="mod">The manifest of the mod defining the token (see <see cref="Mod.ModManifest"/> on your entry class).</param>
/// <param name="name">The token name. This only needs to be unique for your mod; Content Patcher will prefix it with your mod ID automatically, like <c>YourName.ExampleMod/SomeTokenName</c>.</param>
/// <param name="token">An arbitrary class with one or more methods from <see cref="ConventionDelegates"/>.</param>
void RegisterToken(IManifest mod, string name, object token);
}
}