本文整理汇总了C++中House::addDoor方法的典型用法代码示例。如果您正苦于以下问题:C++ House::addDoor方法的具体用法?C++ House::addDoor怎么用?C++ House::addDoor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类House
的用法示例。
在下文中一共展示了House::addDoor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadMap
//.........这里部分代码省略.........
return false;
break;
}
}
NODE nodeItem = f.getChildNode(nodeTile, type);
while(nodeItem){
if(type == OTBM_ITEM){
PropStream propStream;
f.getProps(nodeItem, propStream);
Item* item = Item::CreateItem(propStream);
if(!item){
std::stringstream ss;
ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] " << "Failed to create item.";
setLastErrorString(ss.str());
return false;
}
if(item->unserializeItemNode(f, nodeItem, propStream)){
if(isHouseTile && !item->isNotMoveable()){
std::cout << "Warning: [OTBM loader] Moveable item in house id = " << house->getHouseId() << " Item type = " << item->getID() << std::endl;
delete item;
}
else{
tile->__internalAddThing(item);
item->__startDecaying();
// TESTING
if(isHouseTile){
Door* door = item->getDoor();
if(door && door->getDoorId() != 0){
house->addDoor(door);
}
}
//
}
}
else{
std::stringstream ss;
ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] " << "Failed to load item " << item->getID() << ".";
setLastErrorString(ss.str());
delete item;
return false;
}
}
else{
std::stringstream ss;
ss << "[x:" << px << ", y:" << py << ", z:" << pz << "] " << "Unknown node type.";
setLastErrorString(ss.str());
}
nodeItem = f.getNextNode(nodeItem, type);
}
map->setTile(px, py, pz, tile);
}
else{
setLastErrorString("Unknown tile node.");
return false;
}
nodeTile = f.getNextNode(nodeTile, type);
}
}