Namek / artemis-odb-entity-tracker

:game_die: Visual Entity Tracker for ECS library: artemis-odb
http://namek.github.io/artemis-odb-entity-tracker/
26 stars 5 forks source link

'Systems tab' > 'entities column' displays 0 for extended BaseEntitySystem #3

Closed nanonull closed 8 years ago

nanonull commented 8 years ago

Artemis-odb World has entity with Component C Run Entity tracker using Network Connection section > StandaloneMain.java Actual: System for Component C has tracked 0 entities

Expected: System for Component C has tracked 1 entity

If I understood this tab correctly..: issue

System:

import com.artemis.Aspect;
import com.artemis.ComponentMapper;
import com.artemis.systems.IteratingSystem;

public class HealthSystem extends IteratingSystem {

    public static ComponentMapper<HealthComponent> components;

    public HealthSystem() {
        super(Aspect.all(HealthComponent.class));
    }

    @Override
    protected void process(int entityId) {
        HealthComponent healthComponent = components.get(entityId);
        if (healthComponent.health <= 0) {
            if (ExplosiveManager.components.has(entityId)
                    && Actor2dManager.components.has(entityId)) {
                ExplosiveManager.createExplosion(entityId);
            }

            DestroyEntitySystem.components.create(entityId);
        }
    }
}
Namek commented 8 years ago

Yeah, there's definetely something wrong about it. That's probably about newer version of artemis. I'll look into it this week.

Which artemis version are you using?

nanonull commented 8 years ago

I'm using version 1.2.1

Namek commented 8 years ago

https://github.com/Namek/artemis-odb-entity-tracker/commit/9a5a36b12da357cbdc9fcd493908a77915d36c8c should fix this. Please try Entity Tracker v 0.2.1.

nanonull commented 8 years ago

It works on 0.2.1. Great tool!