当前位置: 首页>>代码示例>>C++>>正文


C++ SerializerElement::SetAttribute方法代码示例

本文整理汇总了C++中gd::SerializerElement::SetAttribute方法的典型用法代码示例。如果您正苦于以下问题:C++ SerializerElement::SetAttribute方法的具体用法?C++ SerializerElement::SetAttribute怎么用?C++ SerializerElement::SetAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gd::SerializerElement的用法示例。


在下文中一共展示了SerializerElement::SetAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SerializeTo

void TileSet::SerializeTo(gd::SerializerElement &element) const
{
    element.SetAttribute("version", 2);
    element.SetAttribute("textureName", textureName);
    element.SetAttribute("tileSizeX", tileSize.x);
    element.SetAttribute("tileSizeY", tileSize.y);
    element.SetAttribute("tileSpacingX", tileSpacing.x);
    element.SetAttribute("tileSpacingY", tileSpacing.y);

    //Save if it is collidable or not
    gd::SerializerElement &collidableElem = element.AddChild("collidable");
    for(auto it = m_collidable.begin(); it != m_collidable.end(); ++it)
    {
        gd::SerializerElement &tileElem = collidableElem.AddChild("tile");
        tileElem.SetAttribute("collidable", *it);
    }

    //Save polygons hitboxes
    gd::SerializerElement &tilesElem = element.AddChild("hitboxes");
    for(auto it = m_hitboxes.begin(); it != m_hitboxes.end(); ++it)
    {
        gd::SerializerElement &hitboxElem = tilesElem.AddChild("tileHitbox");
        hitboxElem.SetAttribute("tileId", it->first);
        it->second.SerializeTo(hitboxElem);
    }
}
开发者ID:HaoDrang,项目名称:GD,代码行数:26,代码来源:TileSet.cpp

示例2: SerializeTo

void CppCodeEvent::SerializeTo(gd::SerializerElement& element) const {
  element.SetAttribute("functionToCall", functionToCall);
  element.SetAttribute("functionNameAutogenerated", functionNameAutogenerated);
  element.SetAttribute("inlineCode", inlineCode);
  element.SetAttribute("associatedGDManagedSourceFile",
                       associatedGDManagedSourceFile);

  element.SetAttribute("passSceneAsParameter", passSceneAsParameter);
  element.SetAttribute("passObjectListAsParameter", passObjectListAsParameter);
  element.SetAttribute("objectToPassAsParameter", objectToPassAsParameter);

  element.SetAttribute("codeDisplayedInEditor", codeDisplayedInEditor);
  element.SetAttribute("displayedName", displayedName);
  element.SetAttribute("lastChangeTimeStamp", (int)lastChangeTimeStamp);

  gd::SerializerElement& includesElement = element.AddChild("includes");
  includesElement.ConsiderAsArrayOf("include");
  for (std::size_t i = 0; i < includeFiles.size(); ++i)
    includesElement.AddChild("include").SetValue(includeFiles[i]);

  gd::SerializerElement& dependenciesElement = element.AddChild("dependencies");
  dependenciesElement.ConsiderAsArrayOf("dependency");
  for (std::size_t i = 0; i < dependencies.size(); ++i)
    dependenciesElement.AddChild("dependency")
        .SetAttribute("sourceFile", dependencies[i]);
}
开发者ID:Lizard-13,项目名称:GD,代码行数:26,代码来源:CppCodeEvent.cpp

示例3: DoSerializeTo

void ParticleEmitterObject::DoSerializeTo(
    gd::SerializerElement& element) const {
  element.SetAttribute("particleEditionSimpleMode", particleEditionSimpleMode);
  element.SetAttribute("emissionEditionSimpleMode", emissionEditionSimpleMode);
  element.SetAttribute("gravityEditionSimpleMode", gravityEditionSimpleMode);

  ParticleEmitterBase::SerializeParticleEmitterBaseTo(element);
}
开发者ID:Lizard-13,项目名称:GD,代码行数:8,代码来源:ParticleEmitterObject.cpp

示例4: SerializeTo

void PlatformBehavior::SerializeTo(gd::SerializerElement & element) const
{
    if ( platformType == Ladder)
        element.SetAttribute("platformType", "Ladder");
    else if ( platformType == Jumpthru )
        element.SetAttribute("platformType", "Jumpthru");
    else
        element.SetAttribute("platformType", "NormalPlatform");
}
开发者ID:mateerladnam,项目名称:GD,代码行数:9,代码来源:PlatformBehavior.cpp

示例5: SerializeTo

void NetworkBehavior::SerializeTo(gd::SerializerElement & element) const
{
    element.SetAttribute("sending", sending);
    element.SetAttribute("xPosition", xPosition);
    element.SetAttribute("yPosition", yPosition);
    element.SetAttribute("angle", angle);
    element.SetAttribute("width", width);
    element.SetAttribute("height", height);
    element.SetAttribute("dataPrefix", dataPrefix);
}
开发者ID:alcemirfernandes,项目名称:GD,代码行数:10,代码来源:NetworkBehavior.cpp

示例6: SerializeTo

void PlatformerObjectBehavior::SerializeTo(gd::SerializerElement & element) const
{
    element.SetAttribute("gravity", gravity);
    element.SetAttribute("maxFallingSpeed", maxFallingSpeed);
    element.SetAttribute("acceleration", acceleration);
    element.SetAttribute("deceleration", deceleration);
    element.SetAttribute("maxSpeed", maxSpeed);
    element.SetAttribute("jumpSpeed", jumpSpeed);
    element.SetAttribute("ignoreDefaultControls", ignoreDefaultControls);
    element.SetAttribute("slopeMaxAngle", slopeMaxAngle);
    element.SetAttribute("canGrabPlatforms", canGrabPlatforms);
    element.SetAttribute("yGrabOffset", yGrabOffset);
    element.SetAttribute("xGrabTolerance", xGrabTolerance);
}
开发者ID:trinajstica,项目名称:GD,代码行数:14,代码来源:PlatformerObjectBehavior.cpp

示例7: DoSerializeTo

void TextObject::DoSerializeTo(gd::SerializerElement & element) const
{
    element.AddChild("string").SetValue(GetString());
    element.AddChild("font").SetValue(GetFontFilename());
    element.AddChild("characterSize").SetValue(GetCharacterSize());
    element.AddChild("color").SetAttribute("r", (int)GetColorR())
        .SetAttribute("g", (int)GetColorG())
        .SetAttribute("b", (int)GetColorB());

    element.SetAttribute("smoothed", smoothed);
    element.SetAttribute("bold", bold);
    element.SetAttribute("italic", italic);
    element.SetAttribute("underlined", underlined);
}
开发者ID:HaoDrang,项目名称:GD,代码行数:14,代码来源:TextObject.cpp

示例8: SerializeTo

void TileHitbox::SerializeTo(gd::SerializerElement &element) const
{
    element.SetAttribute("collidable", collidable);

    //Serialize the polygon
    gd::String polygonStr;
    for(std::vector<sf::Vector2f>::const_iterator vertexIt = hitbox.vertices.begin(); vertexIt != hitbox.vertices.end(); vertexIt++)
    {
        if(vertexIt != hitbox.vertices.begin())
            polygonStr += "|";

        polygonStr += gd::String::From(vertexIt->x) + ";" + gd::String::From(vertexIt->y);
    }
    element.SetAttribute("polygon", polygonStr);
}
开发者ID:sakelestemur,项目名称:GD,代码行数:15,代码来源:TileSet.cpp

示例9: SerializeTo

void PathfindingBehavior::SerializeTo(gd::SerializerElement & element) const
{
    element.SetAttribute("allowDiagonals", allowDiagonals);
    element.SetAttribute("acceleration", acceleration);
    element.SetAttribute("maxSpeed", maxSpeed);
    element.SetAttribute("angularMaxSpeed", angularMaxSpeed);
    element.SetAttribute("rotateObject", rotateObject);
    element.SetAttribute("angleOffset", angleOffset);
    element.SetAttribute("cellWidth", (int)cellWidth);
    element.SetAttribute("cellHeight", (int)cellHeight);
    element.SetAttribute("extraBorder", extraBorder);
}
开发者ID:trinajstica,项目名称:GD,代码行数:12,代码来源:PathfindingBehavior.cpp

示例10: SerializeTo

void PlatformerObjectAutomatism::SerializeTo(gd::SerializerElement & element) const
{
    element.SetAttribute("gravity", gravity);
    element.SetAttribute("maxFallingSpeed", maxFallingSpeed);
    element.SetAttribute("acceleration", acceleration);
    element.SetAttribute("deceleration", deceleration);
    element.SetAttribute("maxSpeed", maxSpeed);
    element.SetAttribute("jumpSpeed", jumpSpeed);
    element.SetAttribute("ignoreDefaultControls", ignoreDefaultControls);
    element.SetAttribute("slopeMaxAngle", slopeMaxAngle);

}
开发者ID:Slulego,项目名称:GD,代码行数:12,代码来源:PlatformerObjectAutomatism.cpp

示例11: DoSerializeTo

void LightObject::DoSerializeTo(gd::SerializerElement & element) const
{
    element.SetAttribute("intensity", GetIntensity());
    element.SetAttribute("radius", GetRadius());
    element.SetAttribute("quality", GetQuality());

    element.SetAttribute("colorR", GetColor().r);
    element.SetAttribute("colorG", GetColor().g);
    element.SetAttribute("colorB", GetColor().b);

    element.SetAttribute("globalLight", globalLight);
    element.SetAttribute("globalColorR", globalLightColor.r);
    element.SetAttribute("globalColorG", globalLightColor.g);
    element.SetAttribute("globalColorB", globalLightColor.b);
    element.SetAttribute("globalColorA", globalLightColor.a);
}
开发者ID:alcemirfernandes,项目名称:GD,代码行数:16,代码来源:LightObject.cpp

示例12: SerializeTo

void PathBehavior::SerializeTo(gd::SerializerElement & element) const
{
    SerializePathsTo(element.AddChild("paths"));

    element.SetAttribute("currentPath", GetCurrentPathName());
    element.SetAttribute("speed", GetSpeed());
    element.SetAttribute("offsetX", GetOffsetX());
    element.SetAttribute("offsetY", GetOffsetY());
    element.SetAttribute("angleOffset", angleOffset);
    element.SetAttribute("reverseAtEnd", ReverseAtEnd());
    element.SetAttribute("stopAtEnd", StopAtEnd());
    element.SetAttribute("followAngle", FollowAngle());
}
开发者ID:sanyaade-teachings,项目名称:GD,代码行数:13,代码来源:PathBehavior.cpp

示例13: SerializeTo

void PhysicsBehavior::SerializeTo(gd::SerializerElement & element) const
{
    element.SetAttribute("dynamic", dynamic);
    element.SetAttribute("fixedRotation", fixedRotation);
    element.SetAttribute("isBullet", isBullet);
    element.SetAttribute("massDensity", massDensity);
    element.SetAttribute("averageFriction", averageFriction);
    element.SetAttribute("linearDamping", linearDamping);
    element.SetAttribute("angularDamping", angularDamping);
    if ( shapeType == Circle)
        element.SetAttribute("shapeType", "Circle");
    else if( shapeType == CustomPolygon )
        element.SetAttribute("shapeType", "CustomPolygon");
    else
        element.SetAttribute("shapeType", "Box");

    if ( polygonPositioning == OnOrigin )
        element.SetAttribute("positioning", "OnOrigin");
    else
        element.SetAttribute("positioning", "OnCenter");

    element.SetAttribute("autoResizing", automaticResizing);
    element.SetAttribute("polygonWidth", polygonWidth);
    element.SetAttribute("polygonHeight", polygonHeight);

    element.SetAttribute("coordsList", PhysicsBehavior::GetStringFromCoordsVector(GetPolygonCoords(), '/', ';'));
    element.SetAttribute("averageRestitution", averageRestitution);
}
开发者ID:HaoDrang,项目名称:GD,代码行数:28,代码来源:PhysicsBehavior.cpp

示例14: SavePoint

void SavePoint(const Point & point, gd::SerializerElement & element)
{
    element.SetAttribute("name", point.GetName());
    element.SetAttribute("x", point.GetX());
    element.SetAttribute("y", point.GetY());
}
开发者ID:heyuqi,项目名称:GD,代码行数:6,代码来源:Direction.cpp

示例15: SerializeTo

void Direction::SerializeTo(gd::SerializerElement & element) const
{
    element.SetAttribute("looping", IsLooping());
    element.SetAttribute("timeBetweenFrames", GetTimeBetweenFrames());
    SaveSpritesDirection(sprites, element.AddChild("sprites"));
}
开发者ID:heyuqi,项目名称:GD,代码行数:6,代码来源:Direction.cpp


注:本文中的gd::SerializerElement::SetAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。