本文整理汇总了C++中Levels::collectionFromLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ Levels::collectionFromLevel方法的具体用法?C++ Levels::collectionFromLevel怎么用?C++ Levels::collectionFromLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Levels
的用法示例。
在下文中一共展示了Levels::collectionFromLevel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
TEST(Levels, load_npz)
{
Levels l;
l.addPath("data/C10_Standard.npz");
ASSERT_EQ(9, l.numLevels());
ASSERT_STREQ("plane sailing", l.levelName(0).c_str());
ASSERT_STREQ("the leap", l.levelName(1).c_str());
ASSERT_STREQ("nautilus", l.levelName(8).c_str());
ASSERT_EQ(1, l.numCollections());
ASSERT_EQ(9, l.collectionSize(0));
int indexInCol;
ASSERT_EQ(0, l.collectionFromLevel(0, &indexInCol));
ASSERT_EQ(0, indexInCol);
ASSERT_EQ(0, l.collectionFromLevel(1, &indexInCol));
ASSERT_EQ(1, indexInCol);
}
示例2: LevelSelector
LevelSelector(GameControl* game, int initialLevel)
: m_game(game),
m_levels(game->m_levels),
m_collection(0),
m_dispbase(0),
m_dispcount(0)
{
m_scroll = new ScrollArea();
m_scroll->fitToParent(true);
m_scroll->virtualSize(Vec2(SCREEN_WIDTH,SCREEN_HEIGHT));
m_content->add(m_scroll,0,0);
fitToParent(true);
int levelInC;
m_collection = m_levels->collectionFromLevel(initialLevel,&levelInC);
setCollection(m_collection, levelInC);
}