13#include "../../Components/Buff.hpp"
14#include "../../Components/Projectile.hpp"
15#include "../../Components/Transform.hpp"
16#include "../../Components/Velocity.hpp"
17#include "../../Components/Weapon.hpp"
18#include "../ISystem.hpp"
36 std::function<void(uint32_t, uint32_t,
float,
float,
float,
float,
float,
int,
bool)>;
145 const Velocity &velocity,
float damage,
bool isFriendly,
160 bool isFriendly,
bool isCharged,
int shotCount);
Base interface for all ECS systems.
Manages entities, their signatures and component type registrations.
Component representing movement direction and speed.
System managing weapon firing and cooldowns.
std::uint32_t fireChargedShot(Registry ®istry, std::uint32_t ownerId, float chargeLevel, bool isFriendly)
Fire a charged shot if charge is sufficient, otherwise fire normal shot.
void update(Registry ®istry, float deltaTime) override
Manages weapon cooldowns for all entities.
std::uint32_t fireWeapon(Registry ®istry, std::uint32_t ownerId, bool isFriendly)
Fire a weapon from an entity, spawning a projectile.
std::function< void(uint32_t, uint32_t, float, float, float, float, float, int, bool)> ProjectileCreatedCallback
Callback for projectile creation events Parameters: projectileId, ownerId, posX, posY,...
ProjectileCreatedCallback _projectileCreatedCallback
WeaponSystem()=default
Default constructor.
~WeaponSystem() override=default
Default destructor.
std::uint32_t createProjectile(Registry ®istry, std::uint32_t ownerId, const Transform &transform, const Velocity &velocity, float damage, bool isFriendly, bool isCharged)
Create a single projectile with specified properties.
ComponentMask getComponentMask() const override
Gets the component mask for this system.
WeaponSystem(ProjectileCreatedCallback callback)
Constructor with callback for projectile creation events.
void fireMultipleShots(Registry ®istry, std::uint32_t ownerId, float damage, float speed, bool isFriendly, bool isCharged, int shotCount)
Fire multiple projectiles based on multishot buff.
Velocity calculateProjectileVelocity(float baseSpeed, bool isFriendly)
Calculate projectile initial velocity based on owner's velocity.
void setProjectileCreatedCallback(ProjectileCreatedCallback callback)
Set the callback for projectile creation events.
Transform calculateProjectileTransform(Registry ®istry, std::uint32_t ownerId, bool isFriendly)
Calculate projectile spawn position based on owner position.
Maximum number of distinct component types supported by the Registry.
std::uint64_t ComponentMask
Type alias for component bitmask.