From 589361e4ce10c9cbd8b8c475b5dadafe5b2f29d3 Mon Sep 17 00:00:00 2001 From: rushiiMachine <33725716+rushiiMachine@users.noreply.github.com> Date: Thu, 28 Mar 2024 12:07:35 -0700 Subject: [PATCH] chore: add missing docs --- Osu.Stubs/Obfuscated.cs | 12 ++++++++++++ Osu.Stubs/Ruleset.cs | 8 ++++---- Osu.Stubs/Score.cs | 10 ++++++++-- Osu.Stubs/Vector2.cs | 15 +++++++++++++++ Osu.Utils/Extensions/ArrayExtensions.cs | 14 ++++++++++++++ 5 files changed, 53 insertions(+), 6 deletions(-) diff --git a/Osu.Stubs/Obfuscated.cs b/Osu.Stubs/Obfuscated.cs index 4c81ccb..55c06af 100644 --- a/Osu.Stubs/Obfuscated.cs +++ b/Osu.Stubs/Obfuscated.cs @@ -7,9 +7,17 @@ namespace Osu.Stubs; +/// +/// Original: osu.Helpers.Obfuscated{T} +/// b20240123: #=z7wrq$zbpx0eedoF3ocH29DF53lUE{#=z62rU_UA=} +/// [UsedImplicitly] public class Obfuscated { + /// + /// Original: Finalize() + /// b20240123: Finalize() + /// private static readonly LazyMethod Finalize = new( "Obfuscated#Finalize()", new[] @@ -29,6 +37,10 @@ public class Obfuscated } ); + /// + /// Original: get_Value() (property getter) + /// b20240123: #=zHT6xZVI= + /// [UsedImplicitly] public static readonly LazyMethod GetValue = new( "Obfuscated#get_Value()", diff --git a/Osu.Stubs/Ruleset.cs b/Osu.Stubs/Ruleset.cs index b5f6e3e..36adde6 100644 --- a/Osu.Stubs/Ruleset.cs +++ b/Osu.Stubs/Ruleset.cs @@ -10,13 +10,13 @@ namespace Osu.Stubs; /// /// Original: osu.GameModes.Play.Rulesets.Ruleset -/// b20240102.2: #=z35zTtWacH8qc$rYRcsQ6iGtK1MBEurfpzNOeLiQ= +/// b20240123: #=zwRa71lIOJzp$VMz5GAIPMrt1N4rdQ4gC2Fx1Jtw= /// public static class Ruleset { /// /// Original: Fail(bool continuousPlay) - /// b20240102.2: #=zWoTE_tk= + /// b20240123: #=zPAIY7AY= /// public static readonly LazyMethod Fail = new( "Ruleset#Fail(...)", @@ -81,7 +81,7 @@ public static class Ruleset /// /// Original: Initialize() - /// b20240123: + /// b20240123: #=znhXnLb4= /// [UsedImplicitly] public static readonly LazyMethod Initialize = new( @@ -117,7 +117,7 @@ public static class Ruleset /// /// Original: ScoreDisplay - /// b20240123: TODO: find this + /// b20240123: #=znVUsSpw8w4aW /// [UsedImplicitly] public static readonly LazyField ScoreDisplay = new( diff --git a/Osu.Stubs/Score.cs b/Osu.Stubs/Score.cs index 4385d23..ce7e966 100644 --- a/Osu.Stubs/Score.cs +++ b/Osu.Stubs/Score.cs @@ -89,7 +89,11 @@ public class Score } ); - // Is of type Obfuscated + /// + /// Is of type Obfuscated{Mods} + /// Original: EnabledMods + /// b20240123: #=zxL1NzqBwrqNU + /// [UsedImplicitly] public static readonly LazyField EnabledMods = new( "Score#EnabledMods", @@ -98,7 +102,9 @@ public class Score field.FieldType.IsGenericType && field.FieldType.GetGenericTypeDefinition() == Obfuscated.RuntimeType) ); - // Generic method Obfuscated.get_Value() bound to the type parameter of + /// + /// The generic method Obfuscated{T}::get_Value() with the type parameter T bound to Mods. + /// [UsedImplicitly] public static readonly LazyMethod EnabledModsGetValue = new( "Obfuscated#get_Value()", diff --git a/Osu.Stubs/Vector2.cs b/Osu.Stubs/Vector2.cs index d511c2c..35b2ea8 100644 --- a/Osu.Stubs/Vector2.cs +++ b/Osu.Stubs/Vector2.cs @@ -5,6 +5,11 @@ namespace Osu.Stubs; +/// +/// Original: Microsoft.Xna.Framework.Vector2 +/// b20240123: Microsoft.Xna.Framework.Vector2 +/// Most names are present because of this class is [Serializable]. +/// [UsedImplicitly] public class Vector2 { @@ -13,6 +18,8 @@ public class Vector2 /// /// Constructor that creates a Vector2 from two distinct float values. + /// Original: Vector2(float, float) + /// b20240123: Vector2(Single, Single) /// [UsedImplicitly] public static readonly LazyMethod Constructor = new( @@ -20,12 +27,20 @@ public class Vector2 () => RuntimeType.GetConstructor([typeof(float), typeof(float)]) ); + /// + /// Original: X + /// b20240123: X + /// [UsedImplicitly] public static readonly LazyField X = new( "Vector2#X", () => RuntimeType.GetField("X") ); + /// + /// Original: Y + /// b20240123: Y + /// [UsedImplicitly] public static readonly LazyField Y = new( "Vector2#Y", diff --git a/Osu.Utils/Extensions/ArrayExtensions.cs b/Osu.Utils/Extensions/ArrayExtensions.cs index f256a03..4b63cea 100644 --- a/Osu.Utils/Extensions/ArrayExtensions.cs +++ b/Osu.Utils/Extensions/ArrayExtensions.cs @@ -4,10 +4,24 @@ namespace Osu.Utils.Extensions; public static class ArrayExtensions { + /// + /// Get the value at an array index or a default value if not in range. + /// + /// Source array + /// Potential index that could exist + /// Alternative default value + /// A non-null type inside the array. + /// The value or default value [UsedImplicitly] public static T? GetOrDefault(this T[] array, int index, T? defaultValue) => index < array.Length ? array[index] : defaultValue; + /// + /// Duplicate all the values in an array a certain amount of times. + /// + /// Source array + /// Amount of times to copy the items. + /// A new array with shallow copied items. [UsedImplicitly] public static T[] Duplicate(this T[] array, int times) {