-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking of non-primitive component fields #5
Comments
I've tested It's possible extract primitive types of classe with: public class RigidBodyComponent extends Component {
public final Vector2 velocity = new Vector2();
}
Class cls = RigidBodyComponent.class;
showFields(cls);
public void showFields(Class cls) {
Field[] fields = cls.getFields();
for (Field field : fields) {
String name = String.valueOf(field.getName());
if (ClassUtils.isPrimitiveOrWrapper(field.getType())) {
Gdx.app.log("Field", name);
} else if (!Modifier.isStatic(field.getModifiers())) {
showFields(field.getType());
}
}
} I'm using for ClassUtils: compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.1' Output was x and y |
Object[] possibleValues = enumValue.getDeclaringClass().getEnumConstants(); returns all enums values |
Hi, thanks for your input. I remember about this issue. However, I've taken the long path to solve it. Instead of serializing just directive primitive fields in components I decided to implement my own serializer that deserializes into general value tree which is to be represtented in GUI. In practice, you should be able to modify any object in your component. No ETA/roadmap, though. More on this here: |
Given:
Component with Field1 of non-primitive type
Expected:
String.valueOf(Field1) is invoked and this result is displayed (read-only) in Component-Details-View for Field1
Actual:
'reference' text is displayed for Field1
The text was updated successfully, but these errors were encountered: