use of com.b3dgs.lionengine.game.feature.collidable.Collision in project lionengine by b3dgs.
the class CollidableFramedConfig method exports.
/**
* Create an XML node from a collision.
*
* @param root The node root (must not be <code>null</code>).
* @param collisions The collisions reference (must not be <code>null</code>).
*/
public static void exports(Xml root, Map<Integer, Collection<Collision>> collisions) {
Check.notNull(root);
Check.notNull(collisions);
for (final Entry<Integer, Collection<Collision>> entry : collisions.entrySet()) {
for (final Collision collision : entry.getValue()) {
final Xml node = root.createChild(NODE_COLLISION_FRAMED);
node.writeInteger(ATT_NUMBER, entry.getKey().intValue());
node.writeInteger(ATT_OFFSETX, collision.getOffsetX());
node.writeInteger(ATT_OFFSETY, collision.getOffsetY());
node.writeInteger(ATT_WIDTH, collision.getWidth());
node.writeInteger(ATT_HEIGHT, collision.getHeight());
node.writeBoolean(ATT_MIRROR, collision.hasMirror());
}
}
}
Aggregations