本文整理汇总了C++中CGameManager::getView方法的典型用法代码示例。如果您正苦于以下问题:C++ CGameManager::getView方法的具体用法?C++ CGameManager::getView怎么用?C++ CGameManager::getView使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGameManager
的用法示例。
在下文中一共展示了CGameManager::getView方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkNode
bool CPetControl::checkNode(const CString &name) {
CGameManager *gameManager = getGameManager();
if (!gameManager)
return true;
if (name == "NULL")
return false;
CViewItem *view = gameManager->getView();
if (!view)
return true;
CNodeItem *node = view->findNode();
if (!node)
return true;
CString viewName = view->getName();
CString nodeName = node->getName();
CRoomItem *room = getGameManager()->getRoom();
if (room) {
CString roomName = room->getName();
CString newNode;
if (roomName == "1stClassRestaurant") {
} else if (nodeName == "Lobby Node") {
nodeName = "Node 1";
} else if (nodeName == "Entrance Node") {
nodeName = "Node 2";
} else if (nodeName == "MaitreD Node") {
nodeName = "Node 3";
} else if (nodeName == "Scraliontis Table Standing Node") {
nodeName = "Node 4";
} else if (nodeName == "Pellerator Node") {
nodeName = "Node 5";
} else if (nodeName == "SUB Node") {
nodeName = "Node 6";
} else if (nodeName == "Phonograph Node") {
nodeName = "Node 7";
} else if (nodeName == "Scraliontis Table Seated Node") {
nodeName = "Node 8";
}
if (roomName == "MusicRoom") {
if (nodeName == "Musical Instruments")
nodeName = "Node 1";
if (nodeName == "Phonograph Node")
nodeName = "Node 2";
}
}
CString str = CString::format("%s.%s", nodeName.c_str(), viewName.c_str());
str = str.right(5);
str.toLowercase();
CString nameLower = name;
nameLower.toLowercase();
return nameLower.contains(str);
}
示例2: isDoorOrBellbotPresent
bool CPetControl::isDoorOrBellbotPresent() const {
CGameManager *gameManager = getGameManager();
if (!gameManager)
return false;
CViewItem *view = gameManager->getView();
if (!view)
return false;
for (CTreeItem *treeItem = view->getFirstChild(); treeItem;
treeItem = treeItem->scan(view)) {
CString name = treeItem->getName();
if (dynamic_cast<CGameObject *>(treeItem) &&
(name.contains("Doorbot") || name.contains("BellBot")))
return true;
}
return false;
}
示例3: isBotInView
bool CPetControl::isBotInView(const CString &name) const {
CGameManager *gameManager = getGameManager();
if (!gameManager)
return false;
CViewItem *view = gameManager->getView();
if (!view)
return false;
// Iterate to find NPC
for (CTreeItem *child = view->getFirstChild(); child; child = child->scan(view)) {
CGameObject *gameObject = dynamic_cast<CGameObject *>(child);
if (gameObject) {
if (!gameObject->getName().compareToIgnoreCase(name))
return true;
}
}
return false;
}