Introducing KRResourceManager superclass

This commit is contained in:
2019-12-08 16:29:49 -08:00
parent 21ca133e30
commit 94b351f9ee
31 changed files with 447 additions and 49 deletions

View File

@@ -33,7 +33,7 @@
#include "KRBundle.h"
KRBundleManager::KRBundleManager(KRContext &context) : KRContextObject(context) {
KRBundleManager::KRBundleManager(KRContext &context) : KRResourceManager(context) {
}
@@ -44,6 +44,21 @@ KRBundleManager::~KRBundleManager() {
m_bundles.empty();
}
KRResource* KRBundleManager::loadResource(const std::string& name, const std::string& extension, KRDataBlock* data)
{
if (extension.compare("krbundle") == 0) {
return loadBundle(name.c_str() , data);
}
return nullptr;
}
KRResource* KRBundleManager::getResource(const std::string& name, const std::string& extension)
{
if (extension.compare("krbundle") == 0) {
return getBundle(name.c_str());
}
return nullptr;
}
KRBundle *KRBundleManager::loadBundle(const char *szName, KRDataBlock *pData)
{
KRBundle *pBundle = new KRBundle(*m_pContext, szName, pData);