mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-11-19 13:17:10 +00:00
small code stuff
Co-Authored-By: David Higueros <111460331+TheDavSmasher@users.noreply.github.com>
This commit is contained in:
3 files changed
+8
-5
No files matched your search
@@ -154,9 +154,6 @@ public abstract class AbstractOptionGroup<T> : AbstractOptionGroup
|
||||
public abstract class AbstractRoleOptionGroup<T> : AbstractOptionGroup<T>
|
||||
where T : ICustomRole
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override Type OptionableType => typeof(T);
|
||||
|
||||
/// <inheritdoc />
|
||||
public override MenuCategory ParentMenu => MenuCategory.Roles;
|
||||
|
||||
|
||||
@@ -26,9 +26,9 @@ public abstract class LoadableAsset<T>
|
||||
/// Converts the <see cref="LoadableAsset{T}"/> into its <typeparamref name="T"/> by loading the asset.
|
||||
/// </summary>
|
||||
/// <param name="loadable">The <see cref="LoadableAsset{T}"/> to get the asset from.</param>
|
||||
public static implicit operator T(LoadableAsset<T> loadable)
|
||||
public static implicit operator T(LoadableAsset<T>? loadable)
|
||||
{
|
||||
return loadable.LoadAsset();
|
||||
return loadable?.LoadAsset()!;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -96,4 +96,10 @@ public class StateMachineWrapper<T>
|
||||
_propertyCache[parameterName] = property;
|
||||
return (TField)property.GetValue(_stateMachine)!;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Implicitly converts a state machine wrapper into its <typeparamref name="T"/> instance.
|
||||
/// </summary>
|
||||
/// <param name="wrapper">The wrapper.</param>
|
||||
public static implicit operator T(StateMachineWrapper<T> wrapper) => wrapper.Instance;
|
||||
}
|
||||
Reference in new issue
Block a user