mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
Changed parent attribute method signatures
This commit is contained in:
1 parent
3fd3c68aaf
commit
c3384ef850
2 files changed
+8
-8
No files matched your search
@@ -35,16 +35,16 @@ public abstract class ModdedOptionListAttribute(Func<int, string> titler) : Prop
|
||||
|
||||
for (int i = 0; i < list!.Count; i++)
|
||||
{
|
||||
SetValue(HolderOptionList![i], list[i]!);
|
||||
SetValue(i, list[i]!);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the value of the specific option.
|
||||
/// </summary>
|
||||
/// <param name="modOpt">The option to set.</param>
|
||||
/// <param name="idx">The option to set.</param>
|
||||
/// <param name="value">The new value as an object.</param>
|
||||
public abstract void SetValue(IModdedOption modOpt, object value);
|
||||
public abstract void SetValue(int idx, object value);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value of all the options.
|
||||
@@ -58,9 +58,9 @@ public abstract class ModdedOptionListAttribute(Func<int, string> titler) : Prop
|
||||
/// <summary>
|
||||
/// Gets the value of the specific option.
|
||||
/// </summary>
|
||||
/// <param name="modOpt">The option to set.</param>
|
||||
/// <param name="idx">The option to set.</param>
|
||||
/// <returns>The value of the option as an object.</returns>
|
||||
public abstract object GetValue(IModdedOption modOpt);
|
||||
public abstract object GetValue(int idx);
|
||||
|
||||
internal abstract IModdedOptionList? CreateOptionList(object? value, PropertyInfo property);
|
||||
internal abstract IModdedOptionList? CreateOptionList(IList value, PropertyInfo property);
|
||||
}
|
||||
@@ -305,7 +305,7 @@ public static class ModdedOptionsManager
|
||||
{
|
||||
var attribute = (ModdedOptionListAttribute)OptionAttributes.First(
|
||||
pair => pair.Value is ModdedOptionListAttribute list && ReferenceEquals(list.Value, __instance)).Value;
|
||||
attribute.SetValue(attribute.HolderOptionList![index], value);
|
||||
attribute.SetValue(index, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -322,7 +322,7 @@ public static class ModdedOptionsManager
|
||||
{
|
||||
var attribute = (ModdedOptionListAttribute)OptionAttributes.First(
|
||||
pair => pair.Value is ModdedOptionListAttribute list && ReferenceEquals(list.Value, __instance)).Value;
|
||||
__result = attribute.GetValue(attribute.HolderOptionList![index]);
|
||||
__result = attribute.GetValue(index);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user