| 43 | explicit MovementSystem(string label = "") : label(label) {} |
| 44 | |
| 45 | void update(EntityManager &es, EventManager &events, TimeDelta) override { |
| 46 | EntityManager::View entities = |
| 47 | es.entities_with_components<Position, Direction>(); |
| 48 | ComponentHandle<Position> position; |
| 49 | ComponentHandle<Direction> direction; |
| 50 | for (auto entity : entities) { |
| 51 | entity.unpack<Position, Direction>(position, direction); |
| 52 | position->x += direction->x; |
| 53 | position->y += direction->y; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | string label; |
| 58 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected