本文整理汇总了C++中ItemBase::SetRefinesInto方法的典型用法代码示例。如果您正苦于以下问题:C++ ItemBase::SetRefinesInto方法的具体用法?C++ ItemBase::SetRefinesInto怎么用?C++ ItemBase::SetRefinesInto使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ItemBase
的用法示例。
在下文中一共展示了ItemBase::SetRefinesInto方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetRefineInfo
// Major hack until we get good item information
// TODO: we have got good item info now, we can do this properly
void ItemBaseManager::SetRefineInfo()
{
ItemBase * item = 0;
ItemBase * refines_into = 0;
char name_buffer[128];
char * name_end;
for (int i=0; i<MAX_ITEMBASE_ITEMS; i++)
{
if (item = GetItem(i))
{
if (strstr(item->Description(), "Refines to: ") != 0)
{
if (name_end = strchr(item->Description(), '\\'))
{
memcpy(name_buffer, item->Description() + 12, name_end - item->Description() - 12);
name_buffer[name_end - item->Description() - 12] = '\0';
}
else if(name_end = strchr(item->Description(), '\n'))
{
memcpy(name_buffer, item->Description() + 12, name_end - item->Description() - 12);
name_buffer[name_end - item->Description() - 12] = '\0';
}
else
{
strcpy(name_buffer, item->Description() + 12);
}
//printf("SetRefineInfo - Refines Into: %s\n",name_buffer);
if (refines_into = GetItem(name_buffer))
{
item->SetRefinesInto(refines_into->ItemTemplateID());
refines_into->SetComponent(0, item->ItemTemplateID());
refines_into->SetComponent(1, item->ItemTemplateID());
refines_into->SetComponent(2, -2);
refines_into->SetComponent(3, -2);
refines_into->SetComponent(4, -2);
refines_into->SetComponent(5, -2);
}
}
}
}
printf("Refining information parsed\n");
}