APIs
There are 2 main types of compiled systems. Libraries and Plugins. Libraries are a pre-cursor that are compiled before modules. Plugins are typically for things that need to be enabled & disabled, or provide advanced features that require a GUI to edit settings.
Plugin
Represents a given Plugin. ISelectable can be added to enable Checkbox toggles for your plugin and allows you to receive "OnEnabled" and "OnDisabled" events.
public interface IPlugin : IAuthored, IButtonProvider
{
// core features abstracted.
}
Authored
Only Inheritable via IPlugin.
public interface IAuthored
{
/// <summary>
/// Name of the module
/// </summary>
string Name { get; }
/// <summary>
/// Description of the module
/// </summary>
string Description { get; }
/// <summary>
/// Who wrote it
/// </summary>
string Author { get; }
/// <summary>
/// What version
/// </summary>
Version Version { get; }
}
Buttons
Only Inheritable via IPlugin.
public interface IButtonProvider
{
/// <summary>
/// Text for the button to show up on the Plugins page.
/// If the text is null no button will be present.
/// </summary>
string? ButtonText { get; }
/// <summary>
/// Called when the settings button is clicked
/// </summary>
async Task OnButtonClicked();
}
Selectable
Only Inheritable for IPlugin.
public interface ISelectable
{
/// <summary>
/// Called when the module is selected
/// </summary>
void OnSelect();
/// <summary>
/// Called when the module is deselected
/// </summary>
void OnDeselect();
}
Generic Interfaces
These are optional interfaces that can be applied to any class. Note that these are STATIC interfaces.
OnStart
public interface IOnStart
{
/// <summary>
/// called when the bot is stopped
/// </summary>
static abstract void OnStart();
}
OnStop
public interface IOnStop
{
/// <summary>
/// called when the bot is stopped
/// </summary>
static abstract void OnStop();
}
Updateable
public interface IUpdateable
{
/// <summary>
/// Wants to be updated on every frame.
/// </summary>
static abstract void Update();
}
Combat
see combat
Crafting / Gathering
see combat