本文整理汇总了C++中Section::HasRoom方法的典型用法代码示例。如果您正苦于以下问题:C++ Section::HasRoom方法的具体用法?C++ Section::HasRoom怎么用?C++ Section::HasRoom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Section
的用法示例。
在下文中一共展示了Section::HasRoom方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
Section::Section(Section const& section)
:myComponent(new Component),
room(new Rect),
hasRoom(section.HasRoom()),
hasPath(section.HasPath())
{
*myComponent = *section.myComponent;
*room = *section.room;
roomConnected = section.roomConnected;
groupId = section.groupId;
}
示例2:
std::vector<std::vector<Section*>> MysteryDungeonMaker::ClassifyGroups()
{
std::vector<std::vector<Section*>> groups;
int groupId = 0;
int mapHeight=dungeonSize->DungeonRowNum();
int sectionColumnNum = dungeonSize->DungeonColumnNum();
for (int i = 0; i < mapHeight; i++)
{
for (int j = 0; j < sectionColumnNum; j++)
{
Section* current = §ions[i][j];
if (current->HasRoom())
{
if (groups.empty())
{
groups.push_back(current->SetGroupId(groupId++));
}
else
{
int notMarked = 0;
for (size_t i_groups = 0; i_groups < groups.size(); i_groups++)
{
if (!DungeonMakerHelper::HasComponent(groups[i_groups], current->GetComponent()))
{
notMarked++;
}
}
if (notMarked == groups.size())
groups.push_back(current->SetGroupId(groupId++));
}
}
}
}
return groups;
}