/*********************************************************************
 * \file   AssetA.hpp
 *
 * \author Romain BOULLARD
 * \date   February 2026
 *********************************************************************/
#ifndef BIGFOOT_ENGINETESTS_ASSETA_HPP
#define BIGFOOT_ENGINETESTS_ASSETA_HPP
#include <Engine/BigFile/Asset/AssetContainer.hpp>

#include <EngineTests/BigFile/Asset/AssetA.bfbs_generated.hpp>
#include <EngineTests/BigFile/Asset/AssetA_generated.hpp>

namespace Bigfoot
{
class AssetA
{
  public:
    using FLAT_ASSET = Flat::AssetA;

    AssetA(FlatAssetWrapper<Flat::AssetA>* p_flatAsset):
        m_flatAsset(p_flatAsset)
    {
        // deprecation...
        if (m_flatAsset->Asset().asset_header->version < 2)
        {
            m_flatAsset->Asset().asset_header->version = 2;
        }
    }

    AssetA(const AssetA& p_assetA) = default;
    AssetA(AssetA&& p_assetA) = default;

    [[nodiscard]]
    std::uint32_t& Health()
    {
        return m_flatAsset->Asset().health;
    }

    [[nodiscard]]
    std::uint32_t& Mana()
    {
        return m_flatAsset->Asset().mana;
    }

    [[nodiscard]]
    Flat::AssetHeaderT* AssetHeader()
    {
        return m_flatAsset->Asset().asset_header.get();
    }

    [[nodiscard]]
    const Flat::AssetHeaderT* AssetHeader() const
    {
        return m_flatAsset->Asset().asset_header.get();
    }

    [[nodiscard]]
    static constexpr eastl::span<const std::byte> ReflectionInfo()
    {
        return g_AssetA_bfbs;
    }

    ~AssetA() = default;

    AssetA& operator=(const AssetA& p_assetA) = default;
    AssetA& operator=(AssetA&& p_assetA) = default;

  private:
    FlatAssetWrapper<Flat::AssetA>* m_flatAsset;
};

using AssetAContainer = AssetContainer<AssetA>;
}   // namespace Bigfoot

#endif
