Skip to content

Commit 7dad7a4

Browse files
committed
98% done host preward source gen.
1 parent b52d011 commit 7dad7a4

File tree

8 files changed

+706
-424
lines changed

8 files changed

+706
-424
lines changed

EnumSourceGenerator/HostGenerator.cs

Lines changed: 340 additions & 63 deletions
Large diffs are not rendered by default.

SimpleInjection/Generator/UniqueAttribute.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
/// <strong>ISubContent Performance Impact:</strong>
4545
/// </para>
4646
/// <para>
47-
/// When structs marked with <see cref="UniqueAttribute"/> are used as keys in <see cref="ISubContent{TKey, TValue}"/>
47+
/// When structs marked with <see cref="UniqueAttribute"/> are used as keys in <see cref="ISubContent{TKey, TValue}"/>
4848
/// implementations, the performance improvement is substantial:
4949
/// </para>
5050
/// <list type="bullet">
@@ -69,11 +69,11 @@
6969
/// // Readonly version (recommended for best performance)
7070
/// [Unique]
7171
/// public readonly partial record struct Material(string Name, int Durability, Color Color) : INamed;
72-
///
72+
///
7373
/// // Non-readonly version (still optimized with caching)
7474
/// [Unique]
7575
/// public partial record struct Material(string Name, int Durability, Color Color) : INamed;
76-
///
76+
///
7777
/// public partial class Materials : IContent&lt;Material&gt;
7878
/// {
7979
/// public static Material[] All = [
@@ -82,7 +82,7 @@
8282
/// new("Diamond", 500, Color.White)
8383
/// ];
8484
/// }
85-
///
85+
///
8686
/// // Usage with ISubContent for high-performance lookups:
8787
/// public class MaterialProperties : ISubContent&lt;Material, PropertyData&gt;
8888
/// {
@@ -92,10 +92,10 @@
9292
/// [Materials.Gold] = new PropertyData(/* ... */),
9393
/// // Fast dictionary operations due to optimized Material equality/hashing
9494
/// };
95-
///
95+
///
9696
/// public PropertyData this[Material key] => ByKey[key]; // O(1) lookup
9797
/// }
98-
///
98+
///
9999
/// // Generated code enables fast index-based equality:
100100
/// var iron1 = materials.Iron;
101101
/// var iron2 = materials.Get(MaterialsType.Iron);

0 commit comments

Comments
 (0)