com.wallstop-studios.dxmessaging 2.0.0-rc12 → 2.0.0-rc13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/.gitattributes +63 -63
  2. package/.github/workflows/npm-publish.yml +66 -0
  3. package/CHANGELOG.md.meta +7 -7
  4. package/Editor/Analyzers/Microsoft.CodeAnalysis.CSharp.dll.meta +33 -33
  5. package/Editor/Analyzers/Microsoft.CodeAnalysis.dll.meta +33 -33
  6. package/Editor/Analyzers/System.Reflection.Metadata.dll.meta +33 -33
  7. package/Editor/Analyzers/WallstopStudios.DxMessaging.SourceGenerators.dll.meta +71 -71
  8. package/Editor/Analyzers.meta +8 -8
  9. package/Editor/SetupCscRsp.cs +162 -162
  10. package/Editor/SetupCscRsp.cs.meta +2 -2
  11. package/Editor/WallstopStudios.DxMessaging.Editor.asmdef +17 -17
  12. package/Editor/WallstopStudios.DxMessaging.Editor.asmdef.meta +7 -7
  13. package/Editor.meta +8 -8
  14. package/LICENSE.md +6 -6
  15. package/LICENSE.md.meta +7 -7
  16. package/README.md +387 -364
  17. package/README.md.meta +7 -7
  18. package/Runtime/Core/Attributes/DxAutoMessageTypeAttribute.cs +7 -7
  19. package/Runtime/Core/Attributes/DxAutoMessageTypeAttribute.cs.meta +2 -2
  20. package/Runtime/Core/Attributes/DxBroadcastMessageAttribute.cs +7 -7
  21. package/Runtime/Core/Attributes/DxBroadcastMessageAttribute.cs.meta +2 -2
  22. package/Runtime/Core/Attributes/DxTargetedMessageAttribute.cs +7 -7
  23. package/Runtime/Core/Attributes/DxTargetedMessageAttribute.cs.meta +2 -2
  24. package/Runtime/Core/Attributes/DxUntargetedMessageAttribute.cs +7 -7
  25. package/Runtime/Core/Attributes/DxUntargetedMessageAttribute.cs.meta +2 -2
  26. package/Runtime/Core/Attributes.meta +2 -2
  27. package/Runtime/Core/Extensions/MessageExtensions.cs +342 -342
  28. package/Runtime/Core/Extensions/MessageExtensions.cs.meta +11 -11
  29. package/Runtime/Core/Extensions.meta +8 -8
  30. package/Runtime/Core/IMessage.cs +12 -12
  31. package/Runtime/Core/IMessage.cs.meta +11 -11
  32. package/Runtime/Core/InstanceId.cs +149 -149
  33. package/Runtime/Core/InstanceId.cs.meta +11 -11
  34. package/Runtime/Core/MessageBus/IMessageBus.cs +309 -309
  35. package/Runtime/Core/MessageBus/IMessageBus.cs.meta +11 -11
  36. package/Runtime/Core/MessageBus/MessageBus.cs +2243 -2084
  37. package/Runtime/Core/MessageBus/MessageBus.cs.meta +11 -11
  38. package/Runtime/Core/MessageBus/MessagingRegistration.cs +105 -105
  39. package/Runtime/Core/MessageBus/MessagingRegistration.cs.meta +11 -11
  40. package/Runtime/Core/MessageBus/RegistrationLog.cs +111 -111
  41. package/Runtime/Core/MessageBus/RegistrationLog.cs.meta +11 -11
  42. package/Runtime/Core/MessageBus.meta +8 -8
  43. package/Runtime/Core/MessageHandler.cs +2778 -2759
  44. package/Runtime/Core/MessageHandler.cs.meta +11 -11
  45. package/Runtime/Core/MessageRegistrationHandle.cs +110 -110
  46. package/Runtime/Core/MessageRegistrationHandle.cs.meta +11 -11
  47. package/Runtime/Core/MessageRegistrationToken.cs +1234 -1234
  48. package/Runtime/Core/MessageRegistrationToken.cs.meta +11 -11
  49. package/Runtime/Core/Messages/IBroadcastMessage.cs +27 -27
  50. package/Runtime/Core/Messages/IBroadcastMessage.cs.meta +11 -11
  51. package/Runtime/Core/Messages/ITargetedMessage.cs +27 -27
  52. package/Runtime/Core/Messages/ITargetedMessage.cs.meta +11 -11
  53. package/Runtime/Core/Messages/IUntargetedMessage.cs +27 -27
  54. package/Runtime/Core/Messages/IUntargetedMessage.cs.meta +11 -11
  55. package/Runtime/Core/Messages.meta +8 -8
  56. package/Runtime/Core/MessagingDebug.cs +70 -70
  57. package/Runtime/Core/MessagingDebug.cs.meta +11 -11
  58. package/Runtime/Core.meta +8 -8
  59. package/Runtime/Unity/MessageAwareComponent.cs +77 -77
  60. package/Runtime/Unity/MessageAwareComponent.cs.meta +11 -11
  61. package/Runtime/Unity/MessagingComponent.cs +99 -99
  62. package/Runtime/Unity/MessagingComponent.cs.meta +11 -11
  63. package/Runtime/Unity.meta +8 -8
  64. package/Runtime/WallstopStudios.DxMessaging.asmdef +15 -15
  65. package/Runtime.meta +8 -8
  66. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxAutoMessageTypeGenerator.cs +92 -92
  67. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxAutoMessageTypeGenerator.cs.meta +11 -11
  68. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxBroadcastMessageGenerator.cs +94 -94
  69. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxBroadcastMessageGenerator.cs.meta +2 -2
  70. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxTargetedMessageGenerator.cs +94 -94
  71. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxTargetedMessageGenerator.cs.meta +2 -2
  72. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxUntargetedMessageGenerator.cs +94 -94
  73. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxUntargetedMessageGenerator.cs.meta +2 -2
  74. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.csproj +21 -21
  75. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.csproj.meta +7 -7
  76. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.meta +8 -8
  77. package/SourceGenerators.meta +8 -8
  78. package/Tests/Runtime/Benchmarks/PerformanceTests.cs +373 -310
  79. package/Tests/Runtime/Benchmarks/PerformanceTests.cs.meta +11 -11
  80. package/Tests/Runtime/Benchmarks.meta +8 -8
  81. package/Tests/Runtime/Core/BroadcastTests.cs +899 -899
  82. package/Tests/Runtime/Core/GlobalAcceptAllTests.cs +190 -190
  83. package/Tests/Runtime/Core/GlobalAcceptAllTests.cs.meta +11 -11
  84. package/Tests/Runtime/Core/MessagingTestBase.cs +185 -185
  85. package/Tests/Runtime/Core/MessagingTestBase.cs.meta +11 -11
  86. package/Tests/Runtime/Core/NominalTests.cs +1740 -1740
  87. package/Tests/Runtime/Core/PostProcessorTests.cs +1236 -1236
  88. package/Tests/Runtime/Core/PostProcessorTests.cs.meta +11 -11
  89. package/Tests/Runtime/Core/RegistrationTests.cs +1266 -1266
  90. package/Tests/Runtime/Core/RegistrationTests.cs.meta +11 -11
  91. package/Tests/Runtime/Core/TargetedTests.cs +888 -888
  92. package/Tests/Runtime/Core/TargetedTests.cs.meta +11 -11
  93. package/Tests/Runtime/Core/UntargetedTests.cs +272 -272
  94. package/Tests/Runtime/Core/UntargetedTests.cs.meta +11 -11
  95. package/Tests/Runtime/Scripts/Components/EmptyMessageAwareComponent.cs +9 -9
  96. package/Tests/Runtime/Scripts/Components/EmptyMessageAwareComponent.cs.meta +11 -11
  97. package/Tests/Runtime/Scripts/Components/SimpleMessageAwareComponent.cs +186 -186
  98. package/Tests/Runtime/Scripts/Messages/ComplexTargetedMessage.cs +30 -30
  99. package/Tests/Runtime/Scripts/Messages/SimpleBroadcastMessage.cs +8 -8
  100. package/Tests/Runtime/Scripts/Messages/SimpleTargetedMessage.cs +8 -8
  101. package/Tests/Runtime/Scripts/Messages/SimpleUntargetedMessage.cs +8 -8
  102. package/Tests/Runtime/WallstopStudios.DxMessaging.Tests.Runtime.csproj.meta +7 -7
  103. package/Tests.meta +8 -8
  104. package/Third Party Notices.md.meta +7 -7
  105. package/package.json +36 -36
  106. package/package.json.meta +7 -7
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 760f3c3fe4dffe647b41eef37728c4f4
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 760f3c3fe4dffe647b41eef37728c4f4
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,8 +1,8 @@
1
- fileFormatVersion: 2
2
- guid: 963c131823f1c5948a69209dbac6533f
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 963c131823f1c5948a69209dbac6533f
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
@@ -1,12 +1,12 @@
1
- namespace DxMessaging.Core
2
- {
3
- using System;
4
-
5
- /// <summary>
6
- /// Common base for all Messaging needs. A common base lets us share some implementation details with type safety.
7
- /// </summary>
8
- public interface IMessage
9
- {
10
- Type MessageType => GetType();
11
- }
12
- }
1
+ namespace DxMessaging.Core
2
+ {
3
+ using System;
4
+
5
+ /// <summary>
6
+ /// Common base for all Messaging needs. A common base lets us share some implementation details with type safety.
7
+ /// </summary>
8
+ public interface IMessage
9
+ {
10
+ Type MessageType => GetType();
11
+ }
12
+ }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 7d57ad19529ae9d4eb2521c7f44af929
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 7d57ad19529ae9d4eb2521c7f44af929
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant:
@@ -1,149 +1,149 @@
1
- namespace DxMessaging.Core
2
- {
3
- using System;
4
- using System.Runtime.CompilerServices;
5
- using System.Runtime.Serialization;
6
- using System.Text.Json.Serialization;
7
-
8
- /// <summary>
9
- /// A light abstraction layer over Unity's InstanceId. Meant to uniquely identify a game object.
10
- /// </summary>
11
- [Serializable]
12
- [DataContract]
13
- public readonly struct InstanceId : IComparable, IComparable<InstanceId>, IEquatable<InstanceId>
14
- {
15
- public static readonly InstanceId EmptyId = new(0);
16
-
17
- [JsonInclude]
18
- [JsonPropertyName("id")]
19
- [DataMember(Name = "id")]
20
- public int Id => _id;
21
-
22
- [JsonIgnore]
23
- private readonly int _id;
24
-
25
- #if UNITY_2017_1_OR_NEWER
26
- public UnityEngine.Object Object { get; }
27
- #endif
28
-
29
- [JsonConstructor]
30
- public InstanceId(int id)
31
- {
32
- _id = id;
33
- #if UNITY_2017_1_OR_NEWER
34
- Object = null;
35
- #endif
36
- }
37
-
38
- #if UNITY_2017_1_OR_NEWER
39
- private InstanceId(UnityEngine.Object @object)
40
- {
41
- _id = @object.GetInstanceID();
42
- Object = @object;
43
- }
44
-
45
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
46
- public static implicit operator InstanceId(UnityEngine.GameObject gameObject)
47
- {
48
- if (gameObject == null)
49
- {
50
- throw new ArgumentNullException(nameof(gameObject));
51
- }
52
-
53
- return new InstanceId(gameObject);
54
- }
55
-
56
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
57
- public static implicit operator InstanceId(UnityEngine.Component component)
58
- {
59
- if (component == null)
60
- {
61
- throw new ArgumentNullException(nameof(component));
62
- }
63
-
64
- return new InstanceId(component);
65
- }
66
- #endif
67
-
68
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
69
- public bool Equals(InstanceId other)
70
- {
71
- return _id == other._id;
72
- }
73
-
74
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
75
- public override bool Equals(object other)
76
- {
77
- return other is InstanceId id && Equals(id);
78
- }
79
-
80
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
81
- public override int GetHashCode()
82
- {
83
- return _id;
84
- }
85
-
86
- public override string ToString()
87
- {
88
- #if UNITY_2017_1_OR_NEWER
89
- UnityEngine.Object instance = Object;
90
- string objectName = instance == null ? string.Empty : instance.name;
91
- return $"{{\"Id\": {_id}, \"Name\": \"{objectName}\"}}";
92
- #else
93
- return $"{{\"Id\": {_id}}}";
94
- #endif
95
- }
96
-
97
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
98
- public static bool operator ==(InstanceId lhs, InstanceId rhs)
99
- {
100
- return lhs.Equals(rhs);
101
- }
102
-
103
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
104
- public static bool operator !=(InstanceId lhs, InstanceId rhs)
105
- {
106
- return !lhs.Equals(rhs);
107
- }
108
-
109
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
110
- public static bool operator <(InstanceId lhs, InstanceId rhs)
111
- {
112
- return lhs.CompareTo(rhs) < 0;
113
- }
114
-
115
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
116
- public static bool operator <=(InstanceId lhs, InstanceId rhs)
117
- {
118
- return lhs.CompareTo(rhs) <= 0;
119
- }
120
-
121
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
122
- public static bool operator >(InstanceId lhs, InstanceId rhs)
123
- {
124
- return lhs.CompareTo(rhs) > 0;
125
- }
126
-
127
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
128
- public static bool operator >=(InstanceId lhs, InstanceId rhs)
129
- {
130
- return lhs.CompareTo(rhs) >= 0;
131
- }
132
-
133
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
134
- public int CompareTo(InstanceId other)
135
- {
136
- return _id.CompareTo(other._id);
137
- }
138
-
139
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
140
- public int CompareTo(object rhs)
141
- {
142
- if (rhs is InstanceId other)
143
- {
144
- return CompareTo(other);
145
- }
146
- return -1;
147
- }
148
- }
149
- }
1
+ namespace DxMessaging.Core
2
+ {
3
+ using System;
4
+ using System.Runtime.CompilerServices;
5
+ using System.Runtime.Serialization;
6
+ using System.Text.Json.Serialization;
7
+
8
+ /// <summary>
9
+ /// A light abstraction layer over Unity's InstanceId. Meant to uniquely identify a game object.
10
+ /// </summary>
11
+ [Serializable]
12
+ [DataContract]
13
+ public readonly struct InstanceId : IComparable, IComparable<InstanceId>, IEquatable<InstanceId>
14
+ {
15
+ public static readonly InstanceId EmptyId = new(0);
16
+
17
+ [JsonInclude]
18
+ [JsonPropertyName("id")]
19
+ [DataMember(Name = "id")]
20
+ public int Id => _id;
21
+
22
+ [JsonIgnore]
23
+ private readonly int _id;
24
+
25
+ #if UNITY_2017_1_OR_NEWER
26
+ public UnityEngine.Object Object { get; }
27
+ #endif
28
+
29
+ [JsonConstructor]
30
+ public InstanceId(int id)
31
+ {
32
+ _id = id;
33
+ #if UNITY_2017_1_OR_NEWER
34
+ Object = null;
35
+ #endif
36
+ }
37
+
38
+ #if UNITY_2017_1_OR_NEWER
39
+ private InstanceId(UnityEngine.Object @object)
40
+ {
41
+ _id = @object.GetInstanceID();
42
+ Object = @object;
43
+ }
44
+
45
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
46
+ public static implicit operator InstanceId(UnityEngine.GameObject gameObject)
47
+ {
48
+ if (gameObject == null)
49
+ {
50
+ throw new ArgumentNullException(nameof(gameObject));
51
+ }
52
+
53
+ return new InstanceId(gameObject);
54
+ }
55
+
56
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
57
+ public static implicit operator InstanceId(UnityEngine.Component component)
58
+ {
59
+ if (component == null)
60
+ {
61
+ throw new ArgumentNullException(nameof(component));
62
+ }
63
+
64
+ return new InstanceId(component);
65
+ }
66
+ #endif
67
+
68
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
69
+ public bool Equals(InstanceId other)
70
+ {
71
+ return _id == other._id;
72
+ }
73
+
74
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
75
+ public override bool Equals(object other)
76
+ {
77
+ return other is InstanceId id && Equals(id);
78
+ }
79
+
80
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
81
+ public override int GetHashCode()
82
+ {
83
+ return _id;
84
+ }
85
+
86
+ public override string ToString()
87
+ {
88
+ #if UNITY_2017_1_OR_NEWER
89
+ UnityEngine.Object instance = Object;
90
+ string objectName = instance == null ? string.Empty : instance.name;
91
+ return $"{{\"Id\": {_id}, \"Name\": \"{objectName}\"}}";
92
+ #else
93
+ return $"{{\"Id\": {_id}}}";
94
+ #endif
95
+ }
96
+
97
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
98
+ public static bool operator ==(InstanceId lhs, InstanceId rhs)
99
+ {
100
+ return lhs.Equals(rhs);
101
+ }
102
+
103
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
104
+ public static bool operator !=(InstanceId lhs, InstanceId rhs)
105
+ {
106
+ return !lhs.Equals(rhs);
107
+ }
108
+
109
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
110
+ public static bool operator <(InstanceId lhs, InstanceId rhs)
111
+ {
112
+ return lhs.CompareTo(rhs) < 0;
113
+ }
114
+
115
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
116
+ public static bool operator <=(InstanceId lhs, InstanceId rhs)
117
+ {
118
+ return lhs.CompareTo(rhs) <= 0;
119
+ }
120
+
121
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
122
+ public static bool operator >(InstanceId lhs, InstanceId rhs)
123
+ {
124
+ return lhs.CompareTo(rhs) > 0;
125
+ }
126
+
127
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
128
+ public static bool operator >=(InstanceId lhs, InstanceId rhs)
129
+ {
130
+ return lhs.CompareTo(rhs) >= 0;
131
+ }
132
+
133
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
134
+ public int CompareTo(InstanceId other)
135
+ {
136
+ return _id.CompareTo(other._id);
137
+ }
138
+
139
+ [MethodImpl(MethodImplOptions.AggressiveInlining)]
140
+ public int CompareTo(object rhs)
141
+ {
142
+ if (rhs is InstanceId other)
143
+ {
144
+ return CompareTo(other);
145
+ }
146
+ return -1;
147
+ }
148
+ }
149
+ }
@@ -1,11 +1,11 @@
1
- fileFormatVersion: 2
2
- guid: 41b061d3cfb2f244b9806bfda65e3fa3
3
- MonoImporter:
4
- externalObjects: {}
5
- serializedVersion: 2
6
- defaultReferences: []
7
- executionOrder: 0
8
- icon: {instanceID: 0}
9
- userData:
10
- assetBundleName:
11
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 41b061d3cfb2f244b9806bfda65e3fa3
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: