本文整理汇总了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);
}
}
示例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]);
}
示例3: DoSerializeTo
void ParticleEmitterObject::DoSerializeTo(
gd::SerializerElement& element) const {
element.SetAttribute("particleEditionSimpleMode", particleEditionSimpleMode);
element.SetAttribute("emissionEditionSimpleMode", emissionEditionSimpleMode);
element.SetAttribute("gravityEditionSimpleMode", gravityEditionSimpleMode);
ParticleEmitterBase::SerializeParticleEmitterBaseTo(element);
}
示例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");
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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());
}
示例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);
}
示例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());
}
示例15: SerializeTo
void Direction::SerializeTo(gd::SerializerElement & element) const
{
element.SetAttribute("looping", IsLooping());
element.SetAttribute("timeBetweenFrames", GetTimeBetweenFrames());
SaveSpritesDirection(sprites, element.AddChild("sprites"));
}