Skip to content

Commit dfdef77

Browse files
Proxies
1 parent 3c69952 commit dfdef77

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

Robust.Client/UserInterface/Controllers/UiController.Subscriptions.cs

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ public abstract partial class UIController : IEntityEventSubscriber
99
protected void SubscribeLocalEvent<T>(
1010
EntityEventHandler<T> handler,
1111
Type[]? before = null, Type[]? after = null)
12-
where T : notnull
12+
where T : notnull, allows ref struct
1313
{
1414
EntityManager.EventBus.SubscribeEvent(EventSource.Local, this, handler, GetType(), before, after);
1515
}
1616

1717
protected void SubscribeLocalEvent<T>(
1818
EntityEventRefHandler<T> handler,
1919
Type[]? before = null, Type[]? after = null)
20-
where T : notnull
20+
where T : notnull, allows ref struct
2121
{
2222
EntityManager.EventBus.SubscribeEvent(EventSource.Local, this, handler, GetType(), before, after);
2323
}
2424

2525
protected void UnSubscribeLocalEvent<T>()
26-
where T : notnull
26+
where T : notnull, allows ref struct
2727
{
2828
EntityManager.EventBus.UnsubscribeEvent<T>(EventSource.Local, this);
2929
}
@@ -37,7 +37,7 @@ protected void SubscribeNetworkEvent<T>(
3737
}
3838

3939
protected void UnSubscribeNetworkEvent<T>()
40-
where T : notnull
40+
where T : notnull, allows ref struct
4141
{
4242
EntityManager.EventBus.UnsubscribeEvent<T>(EventSource.Network, this);
4343
}
@@ -51,7 +51,7 @@ protected void SubscribeAllEvent<T>(
5151
}
5252

5353
protected void UnSubscribeAllEvent<T>()
54-
where T : notnull
54+
where T : notnull, allows ref struct
5555
{
5656
EntityManager.EventBus.UnsubscribeEvent<T>(EventSource.All, this);
5757
}

Robust.Shared/GameObjects/EntitySystem.Subscriptions.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public abstract partial class EntitySystem
1919
protected void SubscribeNetworkEvent<T>(
2020
EntityEventHandler<T> handler,
2121
Type[]? before = null, Type[]? after = null)
22-
where T : notnull
22+
where T : notnull, allows ref struct
2323
{
2424
SubEvent(EventSource.Network, handler, before, after);
2525
}
@@ -29,23 +29,23 @@ protected void SubscribeNetworkEvent<T>(
2929
protected void SubscribeLocalEvent<T>(
3030
EntityEventHandler<T> handler,
3131
Type[]? before = null, Type[]? after = null)
32-
where T : notnull
32+
where T : notnull, allows ref struct
3333
{
3434
SubEvent(EventSource.Local, handler, before, after);
3535
}
3636

3737
protected void SubscribeLocalEvent<T>(
3838
EntityEventRefHandler<T> handler,
3939
Type[]? before = null, Type[]? after = null)
40-
where T : notnull
40+
where T : notnull, allows ref struct
4141
{
4242
SubEvent(EventSource.Local, handler, before, after);
4343
}
4444

4545
protected void SubscribeAllEvent<T>(
4646
EntityEventHandler<T> handler,
4747
Type[]? before = null, Type[]? after = null)
48-
where T : notnull
48+
where T : notnull, allows ref struct
4949
{
5050
SubEvent(EventSource.All, handler, before, after);
5151
}
@@ -80,7 +80,7 @@ private void SubEvent<T>(
8080
EventSource src,
8181
EntityEventHandler<T> handler,
8282
Type[]? before, Type[]? after)
83-
where T : notnull
83+
where T : notnull, allows ref struct
8484
{
8585
EntityManager.EventBus.SubscribeEvent(src, this, handler, GetType(), before, after);
8686

@@ -91,7 +91,7 @@ private void SubEvent<T>(
9191
EventSource src,
9292
EntityEventRefHandler<T> handler,
9393
Type[]? before, Type[]? after)
94-
where T : notnull
94+
where T : notnull, allows ref struct
9595
{
9696
EntityManager.EventBus.SubscribeEvent(src, this, handler, GetType(), before, after);
9797

@@ -243,7 +243,7 @@ private abstract class SubBase
243243
public abstract void Unsubscribe(EntitySystem sys, IEventBus bus);
244244
}
245245

246-
private sealed class SubBroadcast<T> : SubBase where T : notnull
246+
private sealed class SubBroadcast<T> : SubBase where T : notnull, allows ref struct
247247
{
248248
private readonly EventSource _source;
249249

Robust.Shared/GameObjects/EntitySystem.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ public virtual void Shutdown()
9595

9696
#region Event Proxy
9797

98-
protected void RaiseLocalEvent<T>(T message) where T : notnull
98+
protected void RaiseLocalEvent<T>(T message) where T : notnull, allows ref struct
9999
{
100100
EntityManager.EventBus.RaiseEvent(EventSource.Local, message);
101101
}
102102

103-
protected void RaiseLocalEvent<T>(ref T message) where T : notnull
103+
protected void RaiseLocalEvent<T>(ref T message) where T : notnull, allows ref struct
104104
{
105105
EntityManager.EventBus.RaiseEvent(EventSource.Local, ref message);
106106
}
@@ -154,7 +154,7 @@ protected void RaiseNetworkEvent(EntityEventArgs message, EntityUid recipient)
154154
}
155155

156156
protected void RaiseLocalEvent<TEvent>(EntityUid uid, TEvent args, bool broadcast = false)
157-
where TEvent : notnull
157+
where TEvent : notnull, allows ref struct
158158
{
159159
EntityManager.EventBus.RaiseLocalEvent(uid, args, broadcast);
160160
}
@@ -165,7 +165,7 @@ protected void RaiseLocalEvent(EntityUid uid, object args, bool broadcast = fals
165165
}
166166

167167
protected void RaiseLocalEvent<TEvent>(EntityUid uid, ref TEvent args, bool broadcast = false)
168-
where TEvent : notnull
168+
where TEvent : notnull, allows ref struct
169169
{
170170
EntityManager.EventBus.RaiseLocalEvent(uid, ref args, broadcast);
171171
}

0 commit comments

Comments
 (0)