#include "CAbstractCustomComponent.hpp"

namespace CosmicCore {
	CAbstractCustomComponent::CAbstractCustomComponent(CEntity& entity): CAbstractComponent(entity)
	{
	}

	void CAbstractCustomComponent::addProperty(std::string name, float value)
	{
		m_properties[name] = value;
	}

	float CAbstractCustomComponent::getProperty(std::string name)
	{
		return m_properties[name];
	}

	void CAbstractCustomComponent::setProperty(std::string name, float value)
	{
		if (m_properties.count(name) != 0)
		{
			m_properties[name] = value;
		}
	}

	nlohmann::json CAbstractCustomComponent::to_json()
	{
		nlohmann::json j;
		j["ComponentType"] = EComponentType::COMPONENT_CUSTOM;
		return j;
	}
}


