#pragma once

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

#include "object.h"

namespace kek {

enum class LightType {
	POINT,
	DIRECTIONAL,
	SPOT
};

class Light {

public:
	glm::vec3 color;

	Light(glm::vec3 color);

	virtual ~Light();

	virtual LightType getType() = 0;

};

class PointLight: public Light, public DefaultObject {

public:
	float constant, linear, quadratic;

	PointLight(glm::vec3 color, float constant, float linear, float quadratic);

	~PointLight();

	LightType getType();

};

class DirectionalLight: public Light {

public:
	glm::vec3 direction;

	DirectionalLight(glm::vec3 color, glm::vec3 direction);

	~DirectionalLight();

	LightType getType();

	void lookAt(glm::vec3 direction);

};

class SpotLight: public Light, public DefaultObject {

public:
	glm::vec3 direction;
	float constant, linear, quadratic;
	float innerCutoff, outerCutoff;

	SpotLight(glm::vec3 color, glm::vec3 direction, float constant, float linear, float quadratic, float innerCutoff, float outerCutoff);

	~SpotLight();

	LightType getType();

	void lookAt(glm::vec3 direction);

};

class LightList {

public:
	std::vector<PointLight *> point;
	std::vector<DirectionalLight *> directional;
	std::vector<SpotLight *> spot;

	LightList();

	void add(Light *light);

};

}
