use of com.gemserk.commons.artemis.templates.EntityFactory in project commons-gdx by gemserk.
the class EntityTemplateTest method shouldUseDefaultParametersIfParameterMissingFromCustomParameters.
@Test
public void shouldUseDefaultParametersIfParameterMissingFromCustomParameters() {
ParametersWrapper weaponBulletParameters = new ParametersWrapper();
// damage and position parameters are missing, but they are on default parameters
EntityTemplate bulletTemplate = new BulletEntityTemplate();
EntityFactory entityFactory = new EntityFactoryImpl(new World());
Entity bullet = entityFactory.instantiate(bulletTemplate, weaponBulletParameters);
DamageComponent damageComponent = bullet.getComponent(DamageComponent.class);
assertThat(damageComponent.getDamage(), IsEqual.equalTo(5f));
}
Aggregations