Say I have a class of type Item, and that class have property, functions, everything. I would like to make it into a generic Object with only the instance data left. I would like to remove all function, static or not. How would I do this?
Some code example:
Item testItem = new Item();
testItem.fieldA = "aaaa";
testItem.functionB("B");
// strip data
Object strippedItem = strip(testItem);
// only data is left
string a = strippedItem.fieldA; // aaaa
strippedItem.functionB("B") // error, functionB does not exist.
I guess to some degree, this question is asking how do I automatically create struct from class without having to declare them.