BigFile/Sasquatch #1

Merged
rboullard merged 100 commits from BigFile into Development 2026-09-01 16:32:02 +00:00
2 changed files with 0 additions and 37 deletions
Showing only changes of commit 17ab916b11 - Show all commits
@@ -45,34 +45,6 @@ class AssetLibrary
return inserted.second;
}
/**
* Get the AssetContainer for a given Asset type
*
* \tparam ASSET The Asset type
* \return The AssetContainer for the Asset type. Nullptr if not found
*/
template<class ASSET>
[[nodiscard]]
AssetContainer<ASSET>* GetAssetContainer()
{
static const AssetTypeID typeID = ASSET::GetTypeID();
return static_cast<AssetContainer<ASSET>*>(GetAssetContainer(typeID));
}
/**
* Get the AssetContainer for a given Asset type
*
* \tparam ASSET The Asset type
* \return The AssetContainer for the Asset type. Nullptr if not found
*/
template<class ASSET>
[[nodiscard]]
const AssetContainer<ASSET>* GetAssetContainer() const
{
static const AssetTypeID typeID = ASSET::GetTypeID();
return static_cast<const AssetContainer<ASSET>*>(GetAssetContainer(typeID));
}
/**
* Get the AssetContainer for a given AssetType
*
@@ -51,18 +51,12 @@ TEST_F(AssetLibraryFixture, GetAssetContainer_ShouldReturnTheAssetContainerIfAva
std::ignore = m_library.Insert(&m_containerB);
std::ignore = m_library.Insert(&m_containerC);
EXPECT_EQ(m_library.GetAssetContainer<AssetA>(), &m_containerA);
EXPECT_EQ(m_library.GetAssetContainer(GetAssetTypeID<AssetA>()), &m_containerA);
EXPECT_EQ(m_library.GetAssetContainer<AssetB>(), &m_containerB);
EXPECT_EQ(m_library.GetAssetContainer(GetAssetTypeID<AssetB>()), &m_containerB);
EXPECT_EQ(m_library.GetAssetContainer<AssetC>(), &m_containerC);
EXPECT_EQ(m_library.GetAssetContainer(GetAssetTypeID<AssetC>()), &m_containerC);
EXPECT_EQ(std::as_const(m_library).GetAssetContainer<AssetA>(), &m_containerA);
EXPECT_EQ(std::as_const(m_library).GetAssetContainer(GetAssetTypeID<AssetA>()), &m_containerA);
EXPECT_EQ(std::as_const(m_library).GetAssetContainer<AssetB>(), &m_containerB);
EXPECT_EQ(std::as_const(m_library).GetAssetContainer(GetAssetTypeID<AssetB>()), &m_containerB);
EXPECT_EQ(std::as_const(m_library).GetAssetContainer<AssetC>(), &m_containerC);
EXPECT_EQ(std::as_const(m_library).GetAssetContainer(GetAssetTypeID<AssetC>()), &m_containerC);
}
@@ -72,10 +66,7 @@ TEST_F(AssetLibraryFixture, GetAssetContainer_ShouldReturnNullptrIfTheContainerD
{
std::ignore = m_library.Insert(&m_containerB);
EXPECT_EQ(m_library.GetAssetContainer<AssetA>(), nullptr);
EXPECT_EQ(m_library.GetAssetContainer(GetAssetTypeID<AssetA>()), nullptr);
EXPECT_EQ(std::as_const(m_library).GetAssetContainer<AssetA>(), nullptr);
EXPECT_EQ(std::as_const(m_library).GetAssetContainer(GetAssetTypeID<AssetA>()), nullptr);
}