You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm using Edge with HaxeFlixel. And I use FlxSprite as a IComponent.
This should reproduce the problem:
var sprite = new FlxSprite();
var entity = engine.create([sprite]);
trace(entity.exists(sprite)); // false
Why?
FlxSprite extends FlxObject and FlxObject extends FlxBasic, thus the key for FlxSprite is flixel.FlxBasic.
But exists() uses Type.getClass() on FlxSprite and it returns flixel.FlxSprite, of course. Hence false.
This is kinda a design problem, I guess.
In the mean time, I'll just replace this in the Entity class:
function key(component : {}) {
var t : Class<Dynamic> = Type.getClass(component),
s = Type.getSuperClass(t);
while(s != null && s != edge.IComponent) {
t = s;
s = Type.getSuperClass(t);
}
return Type.getClassName(t);
}
with this:
function key(component : {}) {
return Type.getClassName(Type.getClass(component));
}
The text was updated successfully, but these errors were encountered:
Hi, I'm using Edge with HaxeFlixel. And I use FlxSprite as a IComponent.
This should reproduce the problem:
Why?
FlxSprite extends FlxObject and FlxObject extends FlxBasic, thus the key for FlxSprite is
flixel.FlxBasic
.But
exists()
usesType.getClass()
on FlxSprite and it returnsflixel.FlxSprite
, of course. Hencefalse
.This is kinda a design problem, I guess.
In the mean time, I'll just replace this in the Entity class:
with this:
The text was updated successfully, but these errors were encountered: