rename some engine methods for consistency

pull/5/head
Evan Hemsley 2019-06-21 17:50:01 -07:00
parent e964055ec1
commit 88248a962c
4 changed files with 12 additions and 12 deletions

View File

@ -144,14 +144,14 @@ namespace Encompass
return componentIDToType[componentID]; return componentIDToType[componentID];
} }
internal Guid GetEntityIDFromComponentID(Guid componentID) internal Guid GetEntityIDByComponentID(Guid componentID)
{ {
return componentIDToEntityID[componentID]; return componentIDToEntityID[componentID];
} }
internal void UpdateComponent<TComponent>(Guid componentID, TComponent newComponentValue) where TComponent : struct, IComponent internal void UpdateComponent<TComponent>(Guid componentID, TComponent newComponentValue) where TComponent : struct, IComponent
{ {
var entityID = GetEntityIDFromComponentID(componentID); var entityID = GetEntityIDByComponentID(componentID);
IDToComponent[componentID] = newComponentValue; IDToComponent[componentID] = newComponentValue;
} }
@ -169,7 +169,7 @@ namespace Encompass
{ {
componentsToActivate.Add(componentID); componentsToActivate.Add(componentID);
var entityID = GetEntityIDFromComponentID(componentID); var entityID = GetEntityIDByComponentID(componentID);
entitiesWithAddedComponents.Add(entityID); entitiesWithAddedComponents.Add(entityID);
} }
@ -177,7 +177,7 @@ namespace Encompass
{ {
componentsToDeactivate.Add(componentID); componentsToDeactivate.Add(componentID);
var entityID = GetEntityIDFromComponentID(componentID); var entityID = GetEntityIDByComponentID(componentID);
entitiesWithRemovedComponents.Add(entityID); entitiesWithRemovedComponents.Add(entityID);
} }
@ -185,7 +185,7 @@ namespace Encompass
{ {
componentsToRemove.Add(componentID); componentsToRemove.Add(componentID);
var entityID = GetEntityIDFromComponentID(componentID); var entityID = GetEntityIDByComponentID(componentID);
entitiesWithRemovedComponents.Add(entityID); entitiesWithRemovedComponents.Add(entityID);
} }

View File

@ -63,14 +63,14 @@ namespace Encompass
return entityManager.GetEntity(entityID); return entityManager.GetEntity(entityID);
} }
protected Guid GetEntityIDFromComponentID(Guid componentID) protected Guid GetEntityIDByComponentID(Guid componentID)
{ {
return componentManager.GetEntityIDFromComponentID(componentID); return componentManager.GetEntityIDByComponentID(componentID);
} }
protected Entity GetEntityFromComponentID(Guid componentID) protected Entity GetEntityByComponentID(Guid componentID)
{ {
return GetEntity(GetEntityIDFromComponentID(componentID)); return GetEntity(GetEntityIDByComponentID(componentID));
} }
protected TComponent GetComponentByID<TComponent>(Guid componentID) where TComponent : struct, IComponent protected TComponent GetComponentByID<TComponent>(Guid componentID) where TComponent : struct, IComponent

View File

@ -52,7 +52,7 @@ namespace Encompass
if (drawComponentTypeToEntityRenderer.ContainsKey(componentType)) if (drawComponentTypeToEntityRenderer.ContainsKey(componentType))
{ {
var renderer = drawComponentTypeToEntityRenderer[componentType]; var renderer = drawComponentTypeToEntityRenderer[componentType];
var entityID = componentManager.GetEntityIDFromComponentID(componentID); var entityID = componentManager.GetEntityIDByComponentID(componentID);
if (renderer.IsTracking(entityID)) if (renderer.IsTracking(entityID))
{ {

View File

@ -392,7 +392,7 @@ namespace Tests
foreach (var componentPair in componentPairs) foreach (var componentPair in componentPairs)
{ {
var componentID = componentPair.Key; var componentID = componentPair.Key;
var entityID = GetEntityIDFromComponentID(componentID); var entityID = GetEntityIDByComponentID(componentID);
Destroy(entityID); Destroy(entityID);
} }
} }
@ -442,7 +442,7 @@ namespace Tests
public override void Update(float dt) public override void Update(float dt)
{ {
var componentID = ReadComponent<MockComponent>().Key; var componentID = ReadComponent<MockComponent>().Key;
entityFromComponentIDResult = GetEntityFromComponentID(componentID); entityFromComponentIDResult = GetEntityByComponentID(componentID);
} }
} }