use of org.terasology.engine.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 = componentMetadata.getUri();
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.getClassOfType(typeArguments[0]);
if (typeClass.isAssignableFrom(MeshAnimation.class)) {
animationSetUris.add(new ComponentFieldUri(uri, fieldMetadata.getName()));
}
}
}
}
}
}
return animationSetUris;
}
Aggregations