Thanks
Future I'll do it the constructor way. Since it seemed to me that it is the "verbose" way. Having this:
Code:
_cmd->_open_guild_stage = &cmd->_open_guild_stage();
is looking weird. It looks like I'm assigning the pointer of _open_guild_stage to _open_guild_stage. Which is definitely
not what it's doing! It's taking the pointer and converting it, and that is not clear.
But to be honest, having both constructor + operator just seems wasteful on my time. After all I have to create ~70+ Classes for that thing. Even though it's not a huge amount of code, its alot when redoing it ~70 times. Since the class leaves CLR land as soon as possible!
What I mean by that is, that the class Up_GmCmd will only have "readonly" fields. So set on constructor and never modified. Since the only purpose of the CLR library is converting the C++ data structure from Protobuf to C# land because protobuf didn't support C# until v3, and the whole code depends on v2.
But don't quite understand this sentence:
It does seem weird to me to do this in an operator though. These are usually used to update the object itself rather than return a new one.
Since all conversion operators return new objects don't they? At least thats how I did it always. Remember I'm just talking about conversion here. Not other operators like == or /.