Permalink
Browse files

Renamed IEntityManager::verifyExistenceOf to hasEntity

  • Loading branch information...
lpmaurice committed Mar 25, 2011
1 parent 119cb23 commit 4b02043395c3032989351e37c022e0c73124462b
@@ -55,7 +55,7 @@ package com.tomseysdavies.ember.base {
/**
* @inheritDoc
*/
- public function verifyExistenceOf(id:String):Boolean
+ public function hasEntity(id:String):Boolean
{
return _components[id] != null;
}
@@ -86,7 +86,7 @@ package com.tomseysdavies.ember.base {
*/
public function addComponent(entityId:String,component:Object):Boolean{
var Component:Class = getClass(component);
- if(!verifyExistenceOf(entityId)){
+ if(!hasEntity(entityId)){
return false;
}
_components[entityId][Component] = component;
@@ -24,7 +24,7 @@ package com.tomseysdavies.ember.core{
*
* @return Boolean, true if an entity with the provided id exists.
*/
- function verifyExistenceOf(id:String):Boolean;
+ function hasEntity(id:String):Boolean;
/**
* unregisters an entity
@@ -26,13 +26,13 @@ package com.tomseysdavies.ember.base
public function testVerifyExistenceOf():void
{
_entityManager.createEntity(SOME_ID);
- assertTrue("Entity was proven to exist.", _entityManager.verifyExistenceOf(SOME_ID));
+ assertTrue("Entity was proven to exist.", _entityManager.hasEntity(SOME_ID));
}
public function testVerifyExistenceOfFailure():void
{
_entityManager.createEntity(SOME_ID);
- assertFalse("Entity was not proven to exist.", _entityManager.verifyExistenceOf("FAIL"));
+ assertFalse("Entity was not proven to exist.", _entityManager.hasEntity("FAIL"));
}
public function testEntityWithoutIDCreated():void
@@ -57,7 +57,7 @@ package com.tomseysdavies.ember.base
{
_entityManager.createEntity(SOME_ID);
_entityManager.removeEntity(SOME_ID);
- assertFalse("Entity was removed.", _entityManager.verifyExistenceOf(SOME_ID));
+ assertFalse("Entity was removed.", _entityManager.hasEntity(SOME_ID));
}
public function testComponentAdded():void
@@ -105,6 +105,15 @@ package com.tomseysdavies.ember.base
assertTrue("Family was retrieved.", result is IFamily);
}
+ /*public function testFamilyContainsComponents():void
+ {
+ var family:IFamily;
+ var entity:IEntity = _entityManager.createEntity();
+ _entityManager.addComponent(entity.id, new ComponentA());
+ family = _entityManager.getEntityFamily(ComponentA);
+ assertTrue("Contains one component.", family.
+ }
+ */
//_________________PRIVATE
private static const SOME_ID:String = "SOME_ID";
private var _entityManager:EntityManager;

0 comments on commit 4b02043

Please sign in to comment.