#ifndef _H_BULLET_H
#define _H_BULLET_H

#include "gameplay/entity.h"
#include <memory>
#include <utility/component.h>
#include <glm/glm.hpp>
#include <vector>
class AnimationSet;
class Camera;

class Bullet : public Entity
{
public:
	Bullet
	(
		const unsigned int owner,
		unsigned shaderID, 
		glm::vec3 fireFrom, 
		glm::vec2 direction, 
		float bulletSpeed, 
		float bulletDrop, 
		glm::vec2 bulletSize
	) :
		Entity(shaderID),
		origin(fireFrom),
		direction(direction),
		bulletSpeed(bulletSpeed),
		bulletDrop(bulletDrop),
		bulletSize(bulletSize) 
	{
		this->setPosition(origin);
		this->setScale(glm::vec3(bulletSize, 1.0f));
		ownerid = owner;
	};

	void addComponent(Component* component);

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

	float getBulletDrop() const { return bulletDrop; }
	glm::vec3 getBulletOrigin() const { return origin; }

	~Bullet();

private:
	unsigned int ownerid;
	glm::vec3 origin;
	glm::vec2 direction;
	float bulletSpeed;
	float bulletDrop;
	glm::vec2 bulletSize;
	std::vector<Component*> components;
};

#endif // _H_BULLET_H