⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 resource_manager.cpp

📁 这是一款2d游戏引擎
💻 CPP
字号:
/*  $Id: resource_manager.cpp,v 1.20 2003/09/19 10:33:02 mbn Exp $
**
**  ClanLib Game SDK
**  Copyright (C) 2003  The ClanLib Team
**  For a total list of contributers see the file CREDITS.
**
**  This library is free software; you can redistribute it and/or
**  modify it under the terms of the GNU Lesser General Public
**  License as published by the Free Software Foundation; either
**  version 2.1 of the License, or (at your option) any later version.
**
**  This library is distributed in the hope that it will be useful,
**  but WITHOUT ANY WARRANTY; without even the implied warranty of
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
**  Lesser General Public License for more details.
**
**  You should have received a copy of the GNU Lesser General Public
**  License along with this library; if not, write to the Free Software
**  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
**
*/

#include "Core/precomp.h"
#include "API/Core/Resources/resource_manager.h"
#include "resource_manager_generic.h"

/////////////////////////////////////////////////////////////////////////////
// CL_ResourceManager construction:

CL_ResourceManager::CL_ResourceManager(
	const std::string &config_file,
	CL_InputSourceProvider *provider,
	bool delete_inputsource_provider)
: impl(new CL_ResourceManager_Generic(config_file, provider, delete_inputsource_provider))
{
	impl->add_ref();
}

CL_ResourceManager::CL_ResourceManager(const CL_ResourceManager &copy)
: impl(copy.impl)
{
	if (impl) impl->add_ref();
}

CL_ResourceManager::CL_ResourceManager()
: impl(new CL_ResourceManager_Generic)
{
}

CL_ResourceManager::~CL_ResourceManager()
{
	if (impl) impl->release_ref();
}

CL_ResourceManager::CL_ResourceManager(CL_ResourceManager_Generic *impl)
: impl(impl)
{
	impl->add_ref();
}

/////////////////////////////////////////////////////////////////////////////
// CL_ResourceManager attributes:

bool CL_ResourceManager::exists(const std::string &res_id)
{
	return impl->exists(res_id);
}

CL_Resource &CL_ResourceManager::get_resource(const std::string &res_id)
{
	return impl->get_resource(res_id);
}

std::list<std::string> CL_ResourceManager::get_all_resources()
{
	return impl->get_all_resources();
}

std::list<std::string> CL_ResourceManager::get_all_resources(const std::string &section_name)
{
	return impl->get_all_resources(section_name);
}

std::list<std::string> CL_ResourceManager::get_all_sections()
{
	return impl->get_all_sections();
}

std::list<std::string> CL_ResourceManager::get_resources_of_type(const std::string &type_id)
{
	return impl->get_resources_of_type(type_id);
}

std::list<std::string> CL_ResourceManager::get_resources_of_type(const std::string &type_id, const std::string &section_name)
{
	return impl->get_resources_of_type(type_id, section_name);
}

CL_InputSourceProvider *CL_ResourceManager::get_resource_provider() const
{
	return impl->get_resource_provider();
}

/////////////////////////////////////////////////////////////////////////////
// CL_ResourceManager signals:

CL_Signal_v1<CL_Resource &> &CL_ResourceManager::sig_resource_added()
{
	return CL_ResourceManager_Generic::sig_resource_added;
}

/////////////////////////////////////////////////////////////////////////////
// CL_ResourceManager operations:

void CL_ResourceManager::operator = (const CL_ResourceManager &copy)
{
	if (impl) impl->release_ref();
	impl = copy.impl;
	if (impl) impl->add_ref();
}

bool CL_ResourceManager::operator == (const CL_ResourceManager &other) const
{
	return impl == other.impl;
}

void CL_ResourceManager::add_resources(const CL_ResourceManager &additional_resources)
{
	impl->add_resources(additional_resources);
}

void CL_ResourceManager::remove_resources(const CL_ResourceManager &additional_resources)
{
	impl->remove_resources(additional_resources);
}

void CL_ResourceManager::load_all()
{
	impl->load_all();
}

void CL_ResourceManager::unload_all()
{
	impl->unload_all();
}

void CL_ResourceManager::load_section(const std::string &section_name)
{
	impl->load_section(section_name);
}

void CL_ResourceManager::unload_section(const std::string &section_name)
{
	impl->unload_section(section_name);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -