4 ms·
Equality is the least of your problems if you multiple instances of the same entity floating around.
by wvenable 6y ago
Equality is the least of your problems if you multiple instances of the same entity floating around.
- taeric 6y agoSometimes you are seeing if a constructed instance equals an existing one. I would presume that is rather common. Especially with points, a basic collision system is often basically an equality check. Right?
- wvenable 6y agoA "point" would be a value type and you wouldn't use reference equality or inheritance for a value type. But if this were a game you might have a "BigBoss" instance than inherits from "Enemy". If you had one boss, you'd only have one instance of it, and you would use reference equality. If you round-tripped and ended up with 2 instances of the same boss then you're already in trouble.