Explorar o código

Improve documentation for C# typed collection wrappers

DE-YU_H14 hai 6 meses
pai
achega
288e3e3af2

+ 8 - 3
modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs

@@ -1035,12 +1035,17 @@ namespace Godot.Collections
     }
     }
 
 
     /// <summary>
     /// <summary>
-    /// Typed wrapper around Godot's Array class, an array of Variant
-    /// typed elements allocated in the engine in C++. Useful when
-    /// interfacing with the engine. Otherwise prefer .NET collections
+    /// Typed wrapper around Godot's Array class, an array of <typeparamref name="T"/>
+    /// annotated, Variant typed elements allocated in the engine in C++.
+    /// Useful when interfacing with the engine. Otherwise prefer .NET collections
     /// such as arrays or <see cref="List{T}"/>.
     /// such as arrays or <see cref="List{T}"/>.
     /// </summary>
     /// </summary>
     /// <typeparam name="T">The type of the array.</typeparam>
     /// <typeparam name="T">The type of the array.</typeparam>
+    /// <remarks>
+    /// While the elements are statically annotated to <typeparamref name="T"/>,
+    /// the underlying array still stores <see cref="Variant"/>, which has the same
+    /// memory footprint per element as an untyped <see cref="Array"/>.
+    /// </remarks>
     [DebuggerTypeProxy(typeof(ArrayDebugView<>))]
     [DebuggerTypeProxy(typeof(ArrayDebugView<>))]
     [DebuggerDisplay("Count = {Count}")]
     [DebuggerDisplay("Count = {Count}")]
     [SuppressMessage("ReSharper", "RedundantExtendsListEntry")]
     [SuppressMessage("ReSharper", "RedundantExtendsListEntry")]

+ 8 - 3
modules/mono/glue/GodotSharp/GodotSharp/Core/Dictionary.cs

@@ -476,13 +476,18 @@ namespace Godot.Collections
     }
     }
 
 
     /// <summary>
     /// <summary>
-    /// Typed wrapper around Godot's Dictionary class, a dictionary of Variant
-    /// typed elements allocated in the engine in C++. Useful when
-    /// interfacing with the engine. Otherwise prefer .NET collections
+    /// Typed wrapper around Godot's Dictionary class, a dictionary of <typeparamref name="TKey"/>
+    /// and <typeparamref name="TValue"/> annotated, Variant typed elements allocated in the engine in C++.
+    /// Useful when interfacing with the engine. Otherwise prefer .NET collections
     /// such as <see cref="System.Collections.Generic.Dictionary{TKey, TValue}"/>.
     /// such as <see cref="System.Collections.Generic.Dictionary{TKey, TValue}"/>.
     /// </summary>
     /// </summary>
     /// <typeparam name="TKey">The type of the dictionary's keys.</typeparam>
     /// <typeparam name="TKey">The type of the dictionary's keys.</typeparam>
     /// <typeparam name="TValue">The type of the dictionary's values.</typeparam>
     /// <typeparam name="TValue">The type of the dictionary's values.</typeparam>
+    /// <remarks>
+    /// While the elements are statically annotated to <typeparamref name="TKey"/> and <typeparamref name="TValue"/>,
+    /// the underlying dictionary still stores <see cref="Variant"/>, which has the same memory footprint per element
+    /// as an untyped <see cref="Dictionary"/>.
+    /// </remarks>
     [DebuggerTypeProxy(typeof(DictionaryDebugView<,>))]
     [DebuggerTypeProxy(typeof(DictionaryDebugView<,>))]
     [DebuggerDisplay("Count = {Count}")]
     [DebuggerDisplay("Count = {Count}")]
     [SuppressMessage("Design", "CA1001", MessageId = "Types that own disposable fields should be disposable",
     [SuppressMessage("Design", "CA1001", MessageId = "Types that own disposable fields should be disposable",