本文整理汇总了C++中CNpc::getPropertyList方法的典型用法代码示例。如果您正苦于以下问题:C++ CNpc::getPropertyList方法的具体用法?C++ CNpc::getPropertyList怎么用?C++ CNpc::getPropertyList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CNpc
的用法示例。
在下文中一共展示了CNpc::getPropertyList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: addNewNpc
int CLevel::addNewNpc(CString& pImage, CString& pCodeFile, float pX, float pY)
{
CStringList codeData;
CString code;
char* dataFile = getDataFile(pCodeFile.text());
if(!strlen(dataFile))
return 0;
if(!codeData.load(dataFile))
return 0;
for(int i = 0; i < codeData.count(); i++)
code << codeData[i] << "\xa7";
// Create the new NPC. Do this before parsing the join commands.
// The CNpc constructor will remove all comments.
CString code2;
CNpc* npc = new CNpc( pImage, code, pX, pY, this, false );
// Now filter out the join commands.
CStringList npcData;
npcData.load( npc->clientCode.text(), "\xa7" );
for ( int j = 0; j < npcData.count(); ++j )
code2 << processNpcLine( npcData[j] ) << "\xa7";
npc->clientCode = code2;
// Now, add all the joined files to the code.
if ( joinList.count() > 0 )
{
CString* file = 0;
while ( (file = (CString*)joinList[0]) != 0 )
{
// Load the source file into memory.
CString dataFile = getDataFile(file->text());
if(dataFile.length())
{
// Append to the end of the script.
CString retVal;
retVal.load(dataFile.text());
retVal.replaceAll("\r\n", "\xa7");
retVal.replaceAll("\n", "\xa7");
npc->clientCode << retVal << "\xa7";
}
delete (CString*)joinList[0];
joinList.remove(0);
}
}
joinList.clear();
npcs.add(npc);
for(int i = 0; i < players.count(); i++)
{
CPlayer* player = (CPlayer*)players[i];
player->sendPacket(CPacket() << (char)SNPCPROPS << (int)npc->id <<
npc->getPropertyList(0));
}
return npc->id;
}