- Joined
- Aug 14, 2009
- Messages
- 2,304
- Reaction score
- 1,189
I'm currently trying to decide whats better.. [In terms of easy of understanding, not in terms of performance. Since both would be equally as fast] (
Using the constructor to do the conversion:
Or use an overloaded operator for that.
Constructor of CLR Class
Method 1:
Method 2:
I'd have to create the class, and return it like this:
Conversion of class
Method 1:
Method 2 (
You must be registered to see links
)Using the constructor to do the conversion:
Code:
HeroArousal(const up::hero_arousal* arousal)
Or use an overloaded operator for that.
Code:
static operator HeroArousal^(const up::hero_arousal* arousal)
Constructor of CLR Class
Method 1:
Code:
SetMoney(const up::set_money* money)
{
_type = (price_type)Convert::ToInt32(money->_type());
_amount = Convert::ToInt32(money->_amount());
}
Method 2:
I'd have to create the class, and return it like this:
Code:
static operator Up_GmCmd^(const up::gm_cmd* cmd)
{
Up_GmCmd^ _cmd = gcnew Up_GmCmd();
return _cmd;
}
Conversion of class
Method 1:
Code:
_cmd->_open_guild_stage = &cmd->_open_guild_stage();
Method 2 (
You must be registered to see links
):
Code:
_cmd->_open_guild_stage = gcnew OpenAllGuildStage(&cmd->_open_guild_stage());