use of org.terasology.engine.core.ComponentFieldUri in project Terasology by MovingBlocks.
the class BehaviorNodeFactory method determineAnimationPoolUris.
private List<ComponentFieldUri> determineAnimationPoolUris() {
final List<ComponentFieldUri> animationSetUris = Lists.newArrayList();
for (ComponentMetadata<?> componentMetadata : componentLibrary.iterateComponentMetadata()) {
SimpleUri uri = new SimpleUri(componentMetadata.getId().toString());
for (FieldMetadata<?, ?> fieldMetadata : componentMetadata.getFields()) {
if (fieldMetadata.getType().isAssignableFrom(List.class)) {
Type fieldType = fieldMetadata.getField().getGenericType();
if (fieldType instanceof ParameterizedType) {
ParameterizedType parameterizedType = (ParameterizedType) fieldType;
Type[] typeArguments = parameterizedType.getActualTypeArguments();
if (typeArguments.length == 1) {
Class<?> typeClass = ReflectionUtil.getRawType(typeArguments[0]);
if (typeClass.isAssignableFrom(MeshAnimation.class)) {
animationSetUris.add(new ComponentFieldUri(uri, fieldMetadata.getName()));
}
}
}
}
}
}
return animationSetUris;
}
Aggregations