namespace systems {
class GunFireSystem : public ISystems {
public:
bool _wasKeyPressed = false;
void operator()(Registry &r, std::shared_ptr<IContext> ctx);
private:
Clock _clock;
};
}; // namespace systems
operator()Purpose:
Executes gunfire logic, checking if the fire key was pressed and managing fire rate based on time.
Parameters:
_wasKeyPressed:
Tracks whether the fire key was previously pressed, preventing continuous firing.
_clock:
Tracks time to control firing rate and cooldown between shots.