/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
 */

#pragma once

#include "Base/UUID.hpp"
#include <yaml-cpp/yaml.h>

namespace YAML
{
	template<>
	struct convert<OpenVulkano::UUID>
	{
		static Node encode(const OpenVulkano::UUID& uuid)
		{
			return Node(uuid.string());
		}

		static bool decode(const Node& node, OpenVulkano::UUID& uuid)
		{
			if (node.IsScalar())
			{
				uuid.assign(node.Scalar());
				return true;
			}
			return false;
		}
	};
}