From be1d77bc6caef69d217e5578450fc1246a85e56b Mon Sep 17 00:00:00 2001
From: David Higueros <111460331+TheDavSmasher@users.noreply.github.com>
Date: Fri, 19 Jun 2026 23:13:10 -0600
Subject: [PATCH] Removed readonly properties that can be more easily
replicated with the indexer
---
MiraAPI/GameOptions/IModdedOptionList.cs | 31 -------------------
.../OptionTypes/ModdedOptionList.cs | 23 --------------
2 files changed, 54 deletions(-)
diff --git a/MiraAPI/GameOptions/IModdedOptionList.cs b/MiraAPI/GameOptions/IModdedOptionList.cs
index 26f9bee9..4fed3b31 100644
--- a/MiraAPI/GameOptions/IModdedOptionList.cs
+++ b/MiraAPI/GameOptions/IModdedOptionList.cs
@@ -1,5 +1,4 @@
using System;
-using System.Collections.Generic;
using BepInEx.Configuration;
using MiraAPI.PluginLoading;
@@ -15,36 +14,11 @@ public interface IModdedOptionList
///
int Count { get; }
- ///
- /// Gets the unique identifiers for the options.
- ///
- IReadOnlyList Ids { get; }
-
- ///
- /// Gets the titles of the options.
- ///
- IReadOnlyList Titles { get; }
-
- ///
- /// Gets the StringName for the options, used for localization.
- ///
- IReadOnlyList StringNames { get; }
-
///
/// Gets or sets the MiraPlugin that created these options.
///
IMiraPlugin? ParentMod { get; set; }
- ///
- /// Gets the game setting data for the options.
- ///
- IReadOnlyList Data { get; }
-
- ///
- /// Gets the OptionBehaviour object of the options.
- ///
- IReadOnlyList OptionBehaviours { get; }
-
///
/// Gets or sets the visibility function for the options.
///
@@ -55,11 +29,6 @@ public interface IModdedOptionList
///
bool IncludeInPreset { get; set; }
- ///
- /// Gets the set of ConfigDefinition for the options, used for BepInEx configuration.
- ///
- IReadOnlyList ConfigDefinitions { get; }
-
///
/// Saves the options to a preset configuration file.
///
diff --git a/MiraAPI/GameOptions/OptionTypes/ModdedOptionList.cs b/MiraAPI/GameOptions/OptionTypes/ModdedOptionList.cs
index aca5b284..7ff88bfc 100644
--- a/MiraAPI/GameOptions/OptionTypes/ModdedOptionList.cs
+++ b/MiraAPI/GameOptions/OptionTypes/ModdedOptionList.cs
@@ -17,18 +17,6 @@ public class ModdedOptionList : IModdedOptionList where T : IModdedOption
///
public int Count { get; }
- ///
- public IReadOnlyList Ids => FromOptions(o => o.Id);
-
- ///
- public IReadOnlyList Titles => FromOptions(o => o.Title);
-
- ///
- public IReadOnlyList StringNames => FromOptions(o => o.StringName);
-
- ///
- public IReadOnlyList Data => FromOptions(o => o.Data);
-
///
public IMiraPlugin? ParentMod
{
@@ -56,12 +44,6 @@ public class ModdedOptionList : IModdedOptionList where T : IModdedOption
///
public bool IncludeInPreset { get; set; }
- ///
- public IReadOnlyList OptionBehaviours => FromOptions(o => o.OptionBehaviour);
-
- ///
- public IReadOnlyList ConfigDefinitions => FromOptions(o => o.ConfigDefinition);
-
///
/// Initializes a new instance of the class.
///
@@ -76,11 +58,6 @@ public class ModdedOptionList : IModdedOptionList where T : IModdedOption
Options = Enumerable.Range(0, Count).Select(optionFactory).ToArray();
}
- internal IReadOnlyList FromOptions(Func getter)
- {
- return Options.Select(getter).ToArray();
- }
-
///
public void SaveToPreset(ConfigFile presetConfig, bool saveDefault = false)
{