示例#1
0
文件: BlockID.cpp 项目: Xury/MCServer
BLOCKTYPE BlockStringToType(const AString & a_BlockTypeString)
{
	int res = atoi(a_BlockTypeString.c_str());
	if ((res != 0) || (a_BlockTypeString.compare("0") == 0))
	{
		// It was a valid number, return that
		return res;
	}
	
	return gsBlockIDMap.Resolve(TrimString(a_BlockTypeString));
}
示例#2
0
int BlockStringToType(const AString & a_BlockTypeString)
{
	int res = atoi(a_BlockTypeString.c_str());
	if ((res != 0) || (a_BlockTypeString.compare("0") == 0))
	{
		// It was a valid number, return that
		return res;
	}
	
	if (!gsBlockIDMap.m_bHasRunInit)
	{
		gsBlockIDMap.init();
	}
	return gsBlockIDMap.Resolve(TrimString(a_BlockTypeString));
}