Hi Guys,
So as the title says, im looking to copy all fields from one class to another at compile time, this includes private members of the source class, basically the lot. Eg:
class Something {
function test() {
trace("something");
}
function test2() {
trace("original");
}
}
class Else {
private var _counter:Int = 100;
function test() {
_counter++;
trace("else " + _counter);
}
}
Macros.copyClass(Else, Something); // Else would be source, Something would be target
var s:Something = new Something();
s.test(); // would output "else 101"
s.test2(); // would output "original"
I seems like mpartial might be the lib im after, but i couldnt get it to compile, it errors with:
/mpartial/1,3,2/mpartial/util/Macros.hx:10: characters 0-34 : Type not found : tink.macro.tools.MacroTools
Any one have an experience with mpartial, or any other lib that will do what im after?
Cheers,
Ian