Reputation: 757
I have interface Resettable which has method reset(). BaseSystem can implement this interface. Somewhere in code i want to get all systems and reset them if they implement Resettable. Something like:
for (BaseSystem system : world.getSystems()) {
if (system instanceof Resettable) {
system.reset();
}
}
However it doesn't work this way. So how can I achieve this?
Upvotes: 1
Views: 182