示例#1
0
文件: Direction.cpp 项目: heyuqi/GD
void OpenPointsSprites(vector < Point > & points, const gd::SerializerElement & element)
{
    element.ConsiderAsArrayOf("point", "Point");
    for (unsigned int i = 0; i < element.GetChildrenCount(); ++i)
    {
        Point point("");
        OpenPoint(point, element.GetChild(i));

        points.push_back(point);
    }
}
示例#2
0
void PathBehavior::UnserializePathsFrom(const gd::SerializerElement & element)
{
    localePaths.clear();

    element.ConsiderAsArrayOf("path", "Path");
    for(std::size_t i = 0;i<element.GetChildrenCount();++i)
    {
        const gd::SerializerElement & pathElement = element.GetChild(i);
        localePaths[pathElement.GetStringAttribute("name")] = GetCoordsVectorFromString(pathElement.GetStringAttribute("coords"), '/', ';');
    }

    if(localePaths.empty())
        localePaths["Object main path"] = std::vector<sf::Vector2f>(1, sf::Vector2f(0,0));
}