#include <vector>

#include "light.h"
#include "constants.h"

namespace kek {

Light::Light(glm::vec3 color) {
	this->color = color;
}

Light::~Light() {

}

PointLight::PointLight(glm::vec3 color, float constant, float linear, float quadratic): Light(color) {
	this->constant = constant;
	this->linear = linear;
	this->quadratic = quadratic;
}

PointLight::~PointLight() {

}

LightType PointLight::getType() {
	return LightType::POINT;
}

DirectionalLight::DirectionalLight(glm::vec3 color, glm::vec3 direction): Light(color) {
	this->direction = direction;
}

DirectionalLight::~DirectionalLight() {

}

LightType DirectionalLight::getType() {
	return LightType::DIRECTIONAL;
}

void DirectionalLight::lookAt(glm::vec3 direction){
	this->direction = direction;
}

SpotLight::SpotLight(glm::vec3 color, glm::vec3 direction, float constant, float linear, float quadratic, float innerCutoff, float outerCutoff): Light(color) {
	this->direction = direction;
	this->constant = constant;
	this->linear = linear;
	this->quadratic = quadratic;
	this->innerCutoff = innerCutoff;
	this->outerCutoff = outerCutoff;
}

SpotLight::~SpotLight() {

}

LightType SpotLight::getType() {
	return LightType::SPOT;
}

void SpotLight::lookAt(glm::vec3 direction) {
	this->direction = direction;
}

LightList::LightList() {

}

void LightList::add(Light *light) {
	switch(light->getType()) {
		case LightType::POINT: point.push_back((PointLight *) light); break;
		case LightType::DIRECTIONAL: directional.push_back((DirectionalLight *) light); break;
		case LightType::SPOT: spot.push_back((SpotLight *) light); break;
	}
}

}
