#pragma once
#include <string>
#include <vector>
#include "canvas/CanvasState.h"
#include "model/PlacedPiece.h"
#include "model/PlacedScenery.h"

namespace TD {

class LayoutXml {
public:
    static std::string Save(const MC::CanvasState& state,
                            const std::string& filePath,
                            const std::string& layoutName);

    static std::string Load(MC::CanvasState& state,
                            const std::string& filePath,
                            std::string& layoutNameOut);

    static std::string SaveBlock(MC::CanvasState& state,
                                 const std::string& filePath,
                                 const std::string& blockName);

    // Reads pieces and scenery from a library block file.
    // sceneryOut may be empty for older block files that predate scenery support.
    static std::string LoadBlock(const std::string& filePath,
                                 std::string& blockNameOut,
                                 std::vector<MC::PlacedPiece>& piecesOut,
                                 std::vector<MC::PlacedScenery>& sceneryOut);
};

} // namespace TD
