Skip to content

Commit 288e3e3

Browse files
committed
Improve documentation for C# typed collection wrappers
1 parent f418603 commit 288e3e3

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

modules/mono/glue/GodotSharp/GodotSharp/Core/Array.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,12 +1035,17 @@ internal interface IGenericGodotArray
10351035
}
10361036

10371037
/// <summary>
1038-
/// Typed wrapper around Godot's Array class, an array of Variant
1039-
/// typed elements allocated in the engine in C++. Useful when
1040-
/// interfacing with the engine. Otherwise prefer .NET collections
1038+
/// Typed wrapper around Godot's Array class, an array of <typeparamref name="T"/>
1039+
/// annotated, Variant typed elements allocated in the engine in C++.
1040+
/// Useful when interfacing with the engine. Otherwise prefer .NET collections
10411041
/// such as arrays or <see cref="List{T}"/>.
10421042
/// </summary>
10431043
/// <typeparam name="T">The type of the array.</typeparam>
1044+
/// <remarks>
1045+
/// While the elements are statically annotated to <typeparamref name="T"/>,
1046+
/// the underlying array still stores <see cref="Variant"/>, which has the same
1047+
/// memory footprint per element as an untyped <see cref="Array"/>.
1048+
/// </remarks>
10441049
[DebuggerTypeProxy(typeof(ArrayDebugView<>))]
10451050
[DebuggerDisplay("Count = {Count}")]
10461051
[SuppressMessage("ReSharper", "RedundantExtendsListEntry")]

modules/mono/glue/GodotSharp/GodotSharp/Core/Dictionary.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,13 +476,18 @@ internal interface IGenericGodotDictionary
476476
}
477477

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

0 commit comments

Comments
 (0)