本文整理汇总了C++中C4PlayerInfo::GetFilename方法的典型用法代码示例。如果您正苦于以下问题:C++ C4PlayerInfo::GetFilename方法的具体用法?C++ C4PlayerInfo::GetFilename怎么用?C++ C4PlayerInfo::GetFilename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C4PlayerInfo
的用法示例。
在下文中一共展示了C4PlayerInfo::GetFilename方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool C4PlayerList::Save(C4Group &hGroup, bool fStoreTiny, const C4PlayerInfoList &rStoreList)
{
StdStrBuf sTempFilename;
bool fSuccess = true;
// Save to external player files and add to group
for (C4Player *pPlr=First; pPlr; pPlr=pPlr->Next)
{
// save only those in the list, and only those with a filename
C4PlayerInfo *pNfo = rStoreList.GetPlayerInfoByID(pPlr->ID);
if (!pNfo) continue;
if (!pNfo->GetFilename() || !*pNfo->GetFilename()) continue;;
// save over original file?
bool fStoreOnOriginal = (!fStoreTiny && pNfo->GetType() == C4PT_User);
// Create temporary file
sTempFilename.Copy(Config.AtTempPath(pNfo->GetFilename()));
if (fStoreOnOriginal)
if (!C4Group_CopyItem(pPlr->Filename, sTempFilename.getData()))
return false;
// Open group
C4Group PlrGroup;
if (!PlrGroup.Open(sTempFilename.getData(), !fStoreOnOriginal))
return false;
// Save player
if (!pPlr->Save(PlrGroup, true, fStoreOnOriginal)) return false;
PlrGroup.Close();
// Add temp file to group
if (!hGroup.Move(sTempFilename.getData(), pNfo->GetFilename())) return false;
}
return fSuccess;
}