17 for (
auto entityId : entities) {
21 auto direction = velocity.getDirection();
22 float speed = velocity.getSpeed();
25 float newX = pos.
x + direction.x * speed * deltaTime;
26 float newY = pos.y + direction.y * speed * deltaTime;
27 transform.setPosition(newX, newY);
32 return (1ULL << getComponentType<Transform>()) | (1ULL << getComponentType<Velocity>());
ComponentMask getComponentMask() const override
Gets the component mask for this system.
void update(Registry ®istry, float deltaTime) override
Updates entity positions based on their velocities.
Manages entities, their signatures and component type registrations.
std::vector< Address > getEntitiesWithMask(Signature requiredMask)
Get all entities matching a specific component mask.
T & getComponent(Address address)
Get a component from an entity.
Component representing movement direction and speed.
Maximum number of distinct component types supported by the Registry.
std::uint64_t ComponentMask
Type alias for component bitmask.