void ETHCustomDataManager::CopyMap(std::map<str_type::string, ETHCustomDataPtr> &inMap) const
{
	inMap.clear();
	for (std::map<str_type::string, ETHCustomDataPtr>::const_iterator iter = m_data.begin(); iter != m_data.end(); iter++)
	{
		switch (iter->second->GetType())
		{
		case ETHDT_FLOAT:
			inMap[iter->first] = ETHCustomDataPtr(new ETHFloatData(iter->second->GetFloat()));
			break;
		case ETHDT_INT:
			inMap[iter->first] = ETHCustomDataPtr(new ETHIntData(iter->second->GetInt()));
			break;
		case ETHDT_UINT:
			inMap[iter->first] = ETHCustomDataPtr(new ETHUIntData(iter->second->GetUInt()));
			break;
		case ETHDT_STRING:
			inMap[iter->first] = ETHCustomDataPtr(new ETHStringData(iter->second->GetString()));
			break;
		case ETHDT_VECTOR2:
			inMap[iter->first] = ETHCustomDataPtr(new ETHVector2Data(iter->second->GetVector2()));
			break;
		case ETHDT_VECTOR3:
			inMap[iter->first] = ETHCustomDataPtr(new ETHVector3Data(iter->second->GetVector3()));
			break;
		};
	}
}
void ETHCustomDataManager::AddData(const str_type::string &name, const ETHCustomDataConstPtr &dataIn)
{
	switch (dataIn->GetType())
	{
		case ETHDT_FLOAT:
			m_data[name] = ETHCustomDataPtr(new ETHFloatData(dataIn->GetFloat()));
			break;
		case ETHDT_INT:
			m_data[name] = ETHCustomDataPtr(new ETHIntData(dataIn->GetInt()));
			break;
		case ETHDT_UINT:
			m_data[name] = ETHCustomDataPtr(new ETHUIntData(dataIn->GetUInt()));
			break;
		case ETHDT_STRING:
			m_data[name] = ETHCustomDataPtr(new ETHStringData(dataIn->GetString()));
			break;
		case ETHDT_VECTOR2:
			m_data[name] = ETHCustomDataPtr(new ETHVector2Data(dataIn->GetVector2()));
			break;
		case ETHDT_VECTOR3:
			m_data[name] = ETHCustomDataPtr(new ETHVector3Data(dataIn->GetVector3()));
			break;
		default:
			break;
	};
}
void ETHCustomDataManager::SetVector3(const str_type::string &name, const Vector3 &v)
{
	m_data[name] = ETHCustomDataPtr(new ETHVector3Data(v));
}
void ETHCustomDataManager::SetString(const str_type::string &name, const str_type::string &sValue)
{
	m_data[name] = ETHCustomDataPtr(new ETHStringData(sValue));
}
void ETHCustomDataManager::SetUInt(const str_type::string &name, const unsigned int &value)
{
	m_data[name] = ETHCustomDataPtr(new ETHUIntData(value));
}
void ETHCustomDataManager::SetFloat(const str_type::string &name, const float &value)
{
	m_data[name] = ETHCustomDataPtr(new ETHFloatData(value));
}
Beispiel #7
0
bool ETHScene::AddVector3Data(const str_type::string &entity, const str_type::string &name, const Vector3 &value)
{
	return AddCustomData(entity, name, ETHCustomDataPtr(new ETHVector3Data(value)));
}
Beispiel #8
0
bool ETHScene::AddUIntData(const str_type::string &entity, const str_type::string &name, const unsigned int value)
{
	return AddCustomData(entity, name, ETHCustomDataPtr(new ETHUIntData(value)));
}
Beispiel #9
0
bool ETHScene::AddFloatData(const str_type::string &entity, const str_type::string &name, const float value)
{
	return AddCustomData(entity, name, ETHCustomDataPtr(new ETHFloatData(value)));
}