I’m wondering about a boolean comparision something like:
i have two different entities:
var a:Entity = FP.world.add(new Entity);
var b:Entity = FP.world.add(new Entity);
and another empty variable for setting a or b in future
var z:Entity = null;
then after z variable was set with random game events like “z = a or b” i want to check which is defined as z like,
if (z == a) trace("z == a");
else if (z == b) trace ("z == b");
that works without any problems. but i’m going to use that comparision in lots of entities like hundreds, because of that, i want to know which is faster for a comparision like that:
i’m curious about is this faster?
if (z.name == a.name) trace("z == a");
else if (z.name == b.name) trace ("z == b");
because of i read that names are unique for every instance?