2020-01-04 18:25:47 +01:00
|
|
|
//
|
|
|
|
// Created by karl on 04.01.20.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef ECSGAME_POSITIONDEBUGSYSTEM_H
|
|
|
|
#define ECSGAME_POSITIONDEBUGSYSTEM_H
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
2020-01-07 13:10:23 +01:00
|
|
|
#include "../Components/Transform.h"
|
2021-01-02 15:20:33 +01:00
|
|
|
#include "../ECS.h"
|
2020-01-04 18:25:47 +01:00
|
|
|
|
|
|
|
using namespace ECS;
|
|
|
|
|
|
|
|
class PositionDebugOutputSystem : public EntitySystem {
|
2021-01-02 15:20:33 +01:00
|
|
|
public:
|
2020-01-04 18:25:47 +01:00
|
|
|
void tick(World *pWorld, float deltaTime) override {
|
2020-01-07 13:10:23 +01:00
|
|
|
pWorld->each<Transform>([&](Entity *ent, ComponentHandle<Transform> transform) {
|
2021-01-02 15:20:33 +01:00
|
|
|
std::cout << ent->getEntityId() << ": " << transform->get_origin().x << ", "
|
|
|
|
<< transform->get_origin().y << ", " << transform->get_origin().z
|
2020-01-04 18:25:47 +01:00
|
|
|
<< std::endl;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2021-01-02 15:20:33 +01:00
|
|
|
#endif // ECSGAME_POSITIONDEBUGSYSTEM_H
|