Skip to content

Commit

Permalink
Additional DefinitionApi documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ari-steas committed Apr 20, 2024
1 parent 77ea79f commit 7ca5c52
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions Data/Scripts/AssemblyScripts/Definitions/DefinitionApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ public class ModularDefinitionApi
public Action OnReady;

/// <summary>
/// Call this to initialize the Modular API.
/// Call this to initialize the Modular API.<br/>
/// <remarks>
/// API methods will be unusable until the endpoints are populated. Check <see cref="IsReady"/> or utilize <see cref="OnReady"/> for safety.
/// </remarks>
/// </summary>
/// <param name="modContext"></param>
/// <param name="onLoad"></param>
/// <param name="onLoad">Method to be triggered when the API is ready.</param>
/// <exception cref="Exception"></exception>
public ModularDefinitionApi(IMyModContext modContext, Action onLoad = null)
{
Expand All @@ -47,18 +50,24 @@ public ModularDefinitionApi(IMyModContext modContext, Action onLoad = null)
}

/// <summary>
/// The currently loaded Modular Assemblies Framework version. Don't touch this either.
/// The currently loaded Modular Assemblies Framework version.
/// <remarks>
/// Not the API version; see <see cref="ApiVersion"/>
/// </remarks>
/// </summary>
public int FrameworkVersion { get; private set; } = -1;

/// <summary>
/// Displays whether the API is ready.
/// Displays whether endpoints are loaded and the API is ready for use.
/// </summary>
public bool IsReady { get; private set; }

/// <summary>
/// Call this to unload the Modular API. It will be called automatically when the Modular Assemblies Framework is
/// closed.
/// Call this to unload the Modular API; i.e. in case of instantiating a new API or for freeing up resources.
/// <remarks>
/// This method will also be called automatically when the Modular Assemblies Framework is
/// closed.
/// </remarks>
/// </summary>
public void UnloadData()
{
Expand Down

0 comments on commit 7ca5c52

Please sign in to comment.