
29 Mar
2008
29 Mar
'08
8:40 p.m.
AMDG Robert Dailey wrote:
It seems that so far we've gotten everything done without RTTI, I would hate to introduce it here.
RTTI is not always evil. It may be less efficient to hash the strings, but it is not worse from a design perspective.
I see what you're saying now. Something like this might be in order:
struct Packet { virtual PacketId GetId() const = 0; };
struct WalkPacket : Packet { static const PacketId ID = PID_WALKPACKET; virtual PacketId GetId() const { return ID; } };
Yep. That works. Just thought I'd point out that this is not so very different from RTTI, after all. In Christ, Steven Watanabe