Newer
Older
#include <memory>
class shoot_controller_impl {
explicit shoot_controller_impl(double delay);
virtual ~shoot_controller_impl() = default;
/// Try to shoot - returns true if can
virtual bool shoot(bool did_shoot);
/// Updates shooting delay timer
void update_timer(double delta_time);
/// Checks if the game can change shoot controller
virtual bool can_switch();
protected:
/// Checks if timer is expired
bool can_shoot() const;
/// Remaining time before you can shoot again
/// Dealy between two shots
typedef std::shared_ptr<shoot_controller_impl> shoot_controller;
class shooter_factory {
public:
static shoot_controller get_single_shooter();
static shoot_controller get_multi_shooter();
};