rename to ReadMessagesWithEntity
parent
9057228795
commit
926c05a4db
|
@ -647,7 +647,13 @@ namespace Encompass
|
||||||
timeManager.ActivateTimeDilation(factor, easeInTime, easeInFunction, activeTime, easeOutTime, easeOutFunction);
|
timeManager.ActivateTimeDilation(factor, easeInTime, easeInFunction, activeTime, easeOutTime, easeOutFunction);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IEnumerable<TMessage> MessagesWithEntity<TMessage>(Entity entity) where TMessage : struct, IMessage, IHasEntity
|
/// <summary>
|
||||||
|
/// Efficiently reads Messages of a given type that all reference the same Entity.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="TMessage">The Message subtype.</typeparam>
|
||||||
|
/// <param name="entity">The entity that all messages in the IEnumerable refer to.</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
protected IEnumerable<TMessage> ReadMessagesWithEntity<TMessage>(Entity entity) where TMessage : struct, IMessage, IHasEntity
|
||||||
{
|
{
|
||||||
return messageManager.WithEntity<TMessage>(entity.ID);
|
return messageManager.WithEntity<TMessage>(entity.ID);
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,6 +60,10 @@ namespace Encompass
|
||||||
CallGenericMethod(type, "ReadMessage", null);
|
CallGenericMethod(type, "ReadMessage", null);
|
||||||
CallGenericMethod(type, "ReadMessages", null);
|
CallGenericMethod(type, "ReadMessages", null);
|
||||||
CallGenericMethod(type, "SomeMessage", null);
|
CallGenericMethod(type, "SomeMessage", null);
|
||||||
|
if (typeof(IHasEntity).IsAssignableFrom(type))
|
||||||
|
{
|
||||||
|
CallGenericMethod(type, "ReadMessagesWithEntity", new Type[] { typeof(Entity) }, new object[] { Entity });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -460,7 +460,7 @@ namespace Tests
|
||||||
|
|
||||||
public override void Update(double dt)
|
public override void Update(double dt)
|
||||||
{
|
{
|
||||||
entityMessageResults = MessagesWithEntity<EntityMessage>(_entity).ToList();
|
entityMessageResults = ReadMessagesWithEntity<EntityMessage>(_entity).ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue