Vector3d<float> XMLHelper::parse(tinyxml2::XMLElement& elem)
{
	const auto x = elem.FloatAttribute("x");
	const auto y = elem.FloatAttribute("y");
	const auto z = elem.FloatAttribute("z");
	return Vector3d<float>(x, y, z);
}
Exemple #2
0
void Fruit::Load(tinyxml2::XMLElement const& element)
{
    char const* sprite = element.Attribute("Sprite");
    assert(sprite);
    m_Sprite.Load(sprite);
    m_Sprite.SetOriginToCentre();

    m_Score = element.IntAttribute("Score");
    m_Appear1 = element.IntAttribute("Appear1");
    m_Appear2 = element.IntAttribute("Appear2");
    m_Time = element.FloatAttribute("Time");
}