modifier options (WIP)

This commit is contained in:
XtraCube committed 2025-03-01 18:34:18 -05:00
1 parent 6f248221d6
commit bbff2dd2d9
15 files changed
+458 -195

No files matched your search

+13 -1
View File
@@ -1,11 +1,13 @@
using System;
using MiraAPI.GameOptions;
using MiraAPI.PluginLoading;
namespace MiraAPI.Modifiers;
/// <summary>
/// Base class for all modifiers.
/// </summary>
public abstract class BaseModifier
public abstract class BaseModifier : IOptionable
{
/// <summary>
/// Gets the player that the modifier is attached to.
@@ -32,6 +34,16 @@ public abstract class BaseModifier
/// </summary>
public uint TypeId => ModifierManager.GetModifierTypeId(GetType()) ?? throw new InvalidOperationException("Modifier is not registered.");
/// <summary>
/// Gets the parent mod of the modifier.
/// </summary>
public MiraPluginInfo ParentMod => Array.Find(
MiraPluginManager.Instance.RegisteredPlugins(),
x => x.Modifiers.Exists(y => y.TypeId == TypeId)
) ?? throw new InvalidOperationException("Modifier is not registered.");
internal ModifierOptionGroup? ModifierOptionsGroup { get; set; }
/// <summary>
/// Gets the modifier name.
/// </summary>