creaturedb.cpp

来自「wowmodelview魔兽世界的模型查看工具。下了看看吧」· C++ 代码 · 共 89 行

CPP
89
字号
#include "creaturedb.h"

CreatureModelDB::CreatureModelDB(): DBCFile("DBFilesClient\\CreatureModelData.dbc")
{

}

CreatureModelDB::~CreatureModelDB()
{

}

CreatureModelDB::Record CreatureModelDB::getByFilename(std::string fn)
{
	/// Brute force search for now
	for(Iterator i=begin(); i!=end(); ++i)
	{
		wxString str(i->getString(Filename));
		if(str.IsSameAs(fn.c_str(), false) == true)
			return (*i);
	}
	throw NotFound();
}

CreatureSkinDB::CreatureSkinDB(): DBCFile("DBFilesClient\\CreatureDisplayInfo.dbc")
{

}

CreatureSkinDB::~CreatureSkinDB()
{

}

CreatureSkinDB::Record CreatureSkinDB::getByModelID(unsigned int id)
{
	/// Brute force search for now
	for(Iterator i=begin(); i!=end(); ++i)
	{
		if(i->getUInt(ModelID) == id)
			return (*i);
	}
	throw NotFound();
}

CreatureSkinDB::Record CreatureSkinDB::getBySkinID(unsigned int id)
{
	/// Brute force search for now
	for(Iterator i=begin(); i!=end(); ++i)
	{
		if(i->getUInt(SkinID) == id)
			return (*i);
	}
	throw NotFound();
}

NPCDB::NPCDB(): DBCFile("DBFilesClient\\CreatureDisplayInfoExtra.dbc")
{
}

NPCDB::~NPCDB()
{
}

NPCDB::Record NPCDB::getByFilename(std::string fn)
{
	/// Brute force search for now
	for(Iterator i=begin(); i!=end(); ++i)
	{
		if(i->getString(Filename) == fn) {
			std::cout << i->getString(Filename) << "\n";
			return (*i);
		}
	}
	throw NotFound();
}

NPCDB::Record NPCDB::getByNPCID(unsigned int id)
{
	/// Brute force search for now
	for(Iterator i=begin(); i!=end(); ++i)
	{
		if(i->getUInt(NPCID) == id)
			return (*i);
	}
	throw NotFound();
}

⌨️ 快捷键说明

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