10#include "../../../Logger/Logger.hpp"
11#include "../../Components/IComponent.hpp"
12#include "../../Components/PendingDestroy.hpp"
13#include "../../Components/Player.hpp"
17 : _screenWidth(screenWidth), _screenHeight(screenHeight) {}
31 std::vector<std::uint32_t> toMarkForDestruction;
33 for (
auto entityId : entities) {
45 LOG_WARNING(
"[BOUNDARY] Player out of bounds at (", pos.x,
", ", pos.y,
49 toMarkForDestruction.push_back(entityId);
54 for (
auto entityId : toMarkForDestruction) {
65 return (1ULL << getComponentType<Transform>());
BoundarySystem(int screenWidth=1920, int screenHeight=1080)
Constructs a BoundarySystem with specified screen dimensions.
void setScreenSize(int width, int height)
Updates the screen dimensions.
ComponentMask getComponentMask() const override
Gets the component mask for this system.
void update(Registry ®istry, float deltaTime) override
Checks entities against screen boundaries.
Marker component indicating entity should be destroyed.
Component identifying an entity as a player with game statistics.
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.
bool hasComponent(Address address)
Check if an entity has a specific component.
void setComponent(Address address, const T &component)
Set/add a component to an entity with its data.
Maximum number of distinct component types supported by the Registry.
std::uint64_t ComponentMask
Type alias for component bitmask.
@ OutOfBounds
Entity went outside screen boundaries.