singular message reads are ref readonly
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
0d969322ad
commit
26216a295f
|
@ -33,9 +33,9 @@ namespace Encompass
|
|||
Lookup<TMessage>().AddIgnoringTimeDilation(message, time);
|
||||
}
|
||||
|
||||
public TMessage First<TMessage>() where TMessage : struct, IMessage
|
||||
public ref readonly TMessage First<TMessage>() where TMessage : struct, IMessage
|
||||
{
|
||||
return Lookup<TMessage>().First();
|
||||
return ref Lookup<TMessage>().First();
|
||||
}
|
||||
|
||||
public Span<TMessage> All<TMessage>() where TMessage : struct, IMessage
|
||||
|
|
|
@ -78,9 +78,9 @@ namespace Encompass
|
|||
_delayedStoreIgnoringTimeDilation.Add((message, time));
|
||||
}
|
||||
|
||||
public TMessage First()
|
||||
public ref readonly TMessage First()
|
||||
{
|
||||
return _store[0];
|
||||
return ref _store[0];
|
||||
}
|
||||
|
||||
public bool Any()
|
||||
|
|
|
@ -731,10 +731,10 @@ namespace Encompass
|
|||
/// Efficiently reads a single Message of a given type that references a given Entity.
|
||||
/// It is recommended to use this method in conjunction with SomeMessageWithEntity to prevent errors.
|
||||
/// </summary>
|
||||
protected TMessage ReadMessageWithEntity<TMessage>(Entity entity) where TMessage : struct, IMessage, IHasEntity
|
||||
protected ref readonly TMessage ReadMessageWithEntity<TMessage>(Entity entity) where TMessage : struct, IMessage, IHasEntity
|
||||
{
|
||||
CheckMessageRead<TMessage>();
|
||||
return _messageManager.WithEntitySingular<TMessage>(entity.ID);
|
||||
return ref _messageManager.WithEntitySingular<TMessage>(entity.ID);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue