本文整理汇总了C++中CBlock::GetBlockByName方法的典型用法代码示例。如果您正苦于以下问题:C++ CBlock::GetBlockByName方法的具体用法?C++ CBlock::GetBlockByName怎么用?C++ CBlock::GetBlockByName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBlock
的用法示例。
在下文中一共展示了CBlock::GetBlockByName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: depositGold
void CImp::depositGold()
{
path.clear();
CBlock *destBlock;
destBlock = CV_GAME_MANAGER->getRoomManager()->getRoom(CV_BLOCK_TYPE_TREASURE_ROOM_ID, this->getOwner());
if(destBlock != NULL)
{
rooms::CRoom *currRoom = CV_GAME_MANAGER->getRoomManager()->getRoom(destBlock->getRoomIndex());
for (std::vector<CBlock*>::iterator rmIter = currRoom->getRoomTilesVector()->begin(); rmIter != currRoom->getRoomTilesVector()->end(); rmIter++)
{
CBlock *thisBlock = *rmIter;
bool found = false;
block_objects::CBlockObject *bObject = thisBlock->GetBlockByName( "MODEL_GOLD250" );
if (bObject != NULL)
{
found = true;
mCurrentBlock = (game_objects::CBlock *)bObject;
break;
}
}
if(mCurrentBlock)
{
cml::vector2i currPos = cml::vector2i((int)floor(mPosition[0]/CV_BLOCK_WIDTH),(int)floor(mPosition[2]/CV_BLOCK_DEPTH));
if(CV_GAME_MANAGER->getPathManager()->findPath(currPos,mCurrentBlock->getLogicalPosition(),&path))
{
m_impState = IS_GOING_TO_DEPOSITING_GOLD_DESTINATION;
return;
}
}
}
mCurrentBlock->addModel("MODEL_GOLD250",mPosition);
this->setGold(0);
}