本文整理汇总了C++中CMonster::getInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ CMonster::getInfo方法的具体用法?C++ CMonster::getInfo怎么用?C++ CMonster::getInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMonster
的用法示例。
在下文中一共展示了CMonster::getInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setTarget
void CTargetInfoWnd::setTarget(long long uid)
{
show(false);
if(uid != m_targetUID) {
// 更換目標物
// 把舊的監控取消
CUnitObject *pOldTargetObject = getTarget();
if(pOldTargetObject != NULL)
pOldTargetObject->removeAdvAttrEventListener(this);
}
m_targetUID = uid;
CUnitObject *pTargetObject = getTarget();
m_pPlayer->setTargetObject(pTargetObject); // 設定玩家目標物
if(pTargetObject != NULL)
pTargetObject->addAdvAttrEventListener(this); // 監聽目標物的資料變動
else
m_targetUID = -1;
#ifdef _GAMEENGINE_3D_
if(pTargetObject != NULL) {
//取得遊戲畫面寬與高
CGraphicsRender *pRenderCore = CRenderLoader::getInstance()->getGraphicsRender("RenderEngine::OGRE");
RECT rect;
memset(&rect, 0, sizeof(rect));
HWND hRenderWnd = pRenderCore->getRenderHwnd();
GetClientRect(hRenderWnd, &rect);
CMonster *pMonster = dynamic_cast<CMonster *>(pTargetObject);
if(pMonster != NULL) {
CMonsterInfo *pMonsterInfo = pMonster->getInfo();
if(pMonsterInfo != NULL) {
if(pMonsterInfo->getLevelGrade() == REGULAR_GRADE) {
int x = ((rect.right - rect.left) - 284) / 2;
m_overlay.setPosition(x, 0);
m_overlay.setSize(284, 84);
m_overlay.setBackImage("UI/BG/RegularMonster");
if(pMonsterInfo->getWistom() == 1) {
m_pBtn[BUTTON_AI]->setPosition(30, 22);
m_pBtn[BUTTON_AI]->setSize(40, 40);
m_pBtn[BUTTON_AI]->setImage("UI/MonsterAI/1");
}
else if(pMonsterInfo->getWistom() == 2) {
m_pBtn[BUTTON_AI]->setPosition(30, 22);
m_pBtn[BUTTON_AI]->setSize(40, 40);
m_pBtn[BUTTON_AI]->setImage("UI/MonsterAI/2");
}
else if(pMonsterInfo->getWistom() == 3) {
m_pBtn[BUTTON_AI]->setPosition(30, 22);
m_pBtn[BUTTON_AI]->setSize(40, 40);
m_pBtn[BUTTON_AI]->setImage("UI/MonsterAI/3");
}
m_pBtn[BUTTON_HP]->setPosition(83, 36);
m_pBtn[BUTTON_HP]->setSize(169, 13);
m_pText[TEXT_LEVEL]->setPosition(9, 33);
m_pText[TEXT_NAME]->setPosition(80, 6);
}
else if(pMonsterInfo->getLevelGrade() == ELITE_GRADE) {
int x = ((rect.right - rect.left) - 284) / 2;
m_overlay.setPosition(x, 0);
m_overlay.setSize(284, 84);
m_overlay.setBackImage("UI/BG/EliteMonster");
if(pMonsterInfo->getWistom() == 1) {
m_pBtn[BUTTON_AI]->setPosition(31, 23);
m_pBtn[BUTTON_AI]->setSize(40, 40);
m_pBtn[BUTTON_AI]->setImage("UI/MonsterAI/1");
}
else if(pMonsterInfo->getWistom() == 2) {
m_pBtn[BUTTON_AI]->setPosition(31, 23);
m_pBtn[BUTTON_AI]->setSize(40, 40);
m_pBtn[BUTTON_AI]->setImage("UI/MonsterAI/2");
}
else if(pMonsterInfo->getWistom() == 3) {
m_pBtn[BUTTON_AI]->setPosition(31, 23);
m_pBtn[BUTTON_AI]->setSize(40, 40);
m_pBtn[BUTTON_AI]->setImage("UI/MonsterAI/3");
}
m_pBtn[BUTTON_HP]->setPosition(84, 36);
m_pBtn[BUTTON_HP]->setSize(169, 13);
m_pText[TEXT_LEVEL]->setPosition(9, 33);
m_pText[TEXT_NAME]->setPosition(95, 3);
}
else if(pMonsterInfo->getLevelGrade() == HERO_GRADE) {
int x = ((rect.right - rect.left) - 397) / 2;
m_overlay.setPosition(x, 0);
m_overlay.setSize(397, 99);
m_overlay.setBackImage("UI/BG/HeroMonster");
if(pMonsterInfo->getWistom() == 1) {
m_pBtn[BUTTON_AI]->setPosition(31, 28);
//.........这里部分代码省略.........