Shirkit wrote:
appel wrote:
You can also do:
world.setSystem(new ABCSystem(Aspect.getAspectFor(A.class)));
world.setSystem(new ABCSystem(Aspect.getAspectFor(B.class)));
world.setSystem(new ABCSystem(Aspect.getAspectFor(C.class)));
Creating three instances of the same system should work for this case.
I didn't knew I could do that, seems like hack ^^
Well, it's possible... only problem is you cannot retrieve the system from the world, it will return you the last inserted system:
Code:
ABCSystem abcSys = world.getSystem(ABCSystem.class); // returns the one for C.class
Better would be to create an abstract ABCSystem which has all the logic, and extend it with ASystem, BSystem and CSystem each defining their own aspect, and they would really only have a constructor. That way you can retrieve from world each system.
But frankly,
Aspect.aspectForOneOfThem(A,B,C), seems like a hack too ^^