LumixEngine/src/script/set_property_visitor.cpp
Mikulas Florek 219979d8e3 lux->lumix
2014-06-25 23:20:33 +02:00

30 lines
583 B
C++

#include "set_property_visitor.h"
namespace Lumix
{
SetPropertyVisitor::SetPropertyVisitor(const char* name, void* value, int value_size)
{
m_property_name = name;
m_value_size = value_size;
m_value = LUMIX_NEW_ARRAY(char, m_value_size);
memcpy(m_value, value, m_value_size);
}
SetPropertyVisitor::~SetPropertyVisitor()
{
LUMIX_DELETE_ARRAY(m_value);
}
void SetPropertyVisitor::visit(const char* name, float& value)
{
if(m_property_name == name && m_value_size == sizeof(value))
{
memcpy(&value, m_value, sizeof(value));
}
}
} // ~namespace Lumix