Okay, so suppose I’ve got a class with a bunch of members like this:
class MyClass {
var classMemberOne:int;
var anotherClassMember:float;
function MyClass() {
classMemberOne = 5;
anotherClassMember = 2.3;
}
}
I want a function listMembers(myobj) that will list the members in it like this.
var myobj:MyClass = new MyClass();
Debug.Log(listMembers(myobj)); // Should print 'classMemberOne' 'anotherClassMember' to the log.
If I made another class or passed in an existing class, it should do the same thing, regardless of the class. This seems incompatible with strict typing (how do you specify the type of input to a function like that?) but I feel confident that there’s some way around it.
Any thoughts?