add SomeMessageWithEntity method to Engine

pull/2/head
thatcosmonaut 2020-01-13 14:59:18 -08:00
parent fada124b39
commit 4f75aeebf1
4 changed files with 20 additions and 0 deletions

View File

@ -53,6 +53,11 @@ namespace Encompass
return Lookup<TMessage>().WithEntity(entityID);
}
public bool SomeWithEntity<TMessage>(int entityID) where TMessage : struct, IMessage, IHasEntity
{
return Lookup<TMessage>().SomeWithEntity(entityID);
}
public void ProcessDelayedMessages(double dilatedDelta, double realtimeDelta)
{
foreach (var store in Stores.Values)

View File

@ -93,6 +93,11 @@ namespace Encompass
return entityToMessage.ContainsKey(entityID) ? entityToMessage[entityID] : System.Linq.Enumerable.Empty<TMessage>();
}
public bool SomeWithEntity(int entityID)
{
return entityToMessage.ContainsKey(entityID) && entityToMessage[entityID].Count > 0;
}
public override void Clear()
{
store.Clear();

View File

@ -658,6 +658,11 @@ namespace Encompass
return messageManager.WithEntity<TMessage>(entity.ID);
}
protected bool SomeMessageWithEntity<TMessage>(Entity entity) where TMessage : struct, IMessage, IHasEntity
{
return messageManager.SomeWithEntity<TMessage>(entity.ID);
}
internal void CheckAndUpdateTracking(int entityID)
{
if (_trackedEntities.Contains(entityID) && !entityQuery.CheckEntity(entityID, componentManager.ExistingBits))

View File

@ -56,5 +56,10 @@ namespace Encompass
{
return messageStore.WithEntity<TMessage>(entityID);
}
internal bool SomeWithEntity<TMessage>(int entityID) where TMessage : struct, IMessage, IHasEntity
{
return messageStore.SomeWithEntity<TMessage>(entityID);
}
}
}