#ifndef _H_BULLETMANAGER_H
#define _H_BULLETMANAGER_H

#include <glm/glm.hpp>
#include <vector>
#include <memory>

#include <utility/component.h>

class Bullet;
class Sprite;
class Shader;
class Camera;
class EventManager;

class BulletManager : public std::enable_shared_from_this<BulletManager>
{
public:
	BulletManager() {}
	void addBullet(const std::shared_ptr<Bullet>& bullet);
	void addBullet(const unsigned int owner, 
		const glm::vec3& fireFrom, 
		const glm::vec2& direction, 
		float bulletSpeed, 
		float bulletDrop,
		glm::vec2 bulletSize,
		const unsigned& shaderID, 
		std::unique_ptr<Component> sprite);

	void update(double deltaTime);
	void draw();

	void hookEventManager(std::weak_ptr<EventManager> eventManager);

	const std::vector<std::shared_ptr<Bullet>> getBullets() const { return bullets; }

private:
	std::vector<std::shared_ptr<Bullet>> bullets;
	std::weak_ptr<EventManager> eventManager;
};

#endif