本文整理汇总了C++中Flags::reset方法的典型用法代码示例。如果您正苦于以下问题:C++ Flags::reset方法的具体用法?C++ Flags::reset怎么用?C++ Flags::reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flags
的用法示例。
在下文中一共展示了Flags::reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateFrame
// フレーム更新。
void UpdateFrame()
{
_flags.reset(FRAME_SKIP);
// if (_frameRateController.GetElapsedTime() > _frameRateController.GetFrameTime() * 2)
// {
// // TODO: あまりにもお粗末な処理…ちゃんと考える。
// _flags.set(FRAME_SKIP);
// }
Draw();
_frameRateController.ChangeFrame();
}
示例2: testFlags
void testFlags() {
log(LOG_DEBUG, "AWL: testing Flags...");
Flags flags;
log(LOG_DEBUG, "AWL: testing Flags 0...");
flags.resize( 0 );
GBASSERT( flags.getNumFlags() == 0 );
GBASSERT( flags.getNumSet() == 0 );
GBASSERT( flags.getLowestSet() == flags.NoMin );
GBASSERT( flags.getHighestSet() == flags.NoMax );
log(LOG_DEBUG, "AWL: testing Flags 1...");
flags.resize( 1 );
GBASSERT( flags.getNumFlags() == 1 );
GBASSERT( ! flags.getFlag( 0 ) );
GBASSERT( flags.getNumSet() == 0 );
GBASSERT( flags.getLowestSet() == flags.NoMin );
GBASSERT( flags.getHighestSet() == flags.NoMax );
log(LOG_DEBUG, "AWL: testing Flags 2...");
flags.setFlag( 0, true );
GBASSERT( flags.getFlag( 0 ) );
GBASSERT( flags.getLowestSet() == flags.getHighestSet() );
GBASSERT( flags.getLowestSet() == 0 );
GBASSERT( flags.getNumSet() == 1 );
GBASSERT( flags.getHighestSet() >= flags.getLowestSet() );
log(LOG_DEBUG, "AWL: testing Flags 3...");
flags.setFlag( 0, false );
GBASSERT( ! flags.getFlag( 0 ) );
GBASSERT( flags.getLowestSet() == flags.NoMin );
GBASSERT( flags.getHighestSet() == flags.NoMax );
GBASSERT( flags.getNumSet() == 0 );
log(LOG_DEBUG, "AWL: testing Flags 4...");
flags.setFlag( 0, true );
flags.resize( 5 );
flags.setFlag( 1, true );
GBASSERT( flags.getNumFlags() == 5 );
GBASSERT( flags.getFlag(0) );
GBASSERT( flags.getFlag(1) );
GBASSERT( flags.getLowestSet() == 0 );
GBASSERT( flags.getHighestSet() == 1 );
GBASSERT( flags.getNumSet() == 2 );
GBASSERT( flags.getHighestSet() >= flags.getLowestSet() );
log(LOG_DEBUG, "AWL: testing Flags 5...");
flags.setFlag( 3, true );
GBASSERT( flags.getFlag( 3 ) );
GBASSERT( flags.getLowestSet() == 0 );
GBASSERT( flags.getHighestSet() == 3 );
GBASSERT( flags.getNumSet() == 3 );
GBASSERT( flags.getHighestSet() >= flags.getLowestSet() );
log(LOG_DEBUG, "AWL: testing Flags 6...");
flags.setFlag( 0, false );
GBASSERT( ! flags.getFlag( 0 ) );
GBASSERT( flags.getLowestSet() == 1 );
GBASSERT( flags.getHighestSet() == 3 );
GBASSERT( flags.getNumSet() == 2 );
GBASSERT( flags.getHighestSet() >= flags.getLowestSet() );
log(LOG_DEBUG, "AWL: testing Flags 7...");
flags.setFlag( 0, true );
flags.setFlag( 2, true );
GBASSERT( flags.getFlag( 0 ) );
GBASSERT( flags.getFlag( 2 ) );
GBASSERT( flags.getLowestSet() == 0 );
GBASSERT( flags.getHighestSet() == 3 );
GBASSERT( flags.getNumSet() == 4 );
GBASSERT( flags.getHighestSet() >= flags.getLowestSet() );
log(LOG_DEBUG, "AWL: testing Flags 8...");
flags.setFlag( 2, false );
GBASSERT( ! flags.getFlag( 2 ) );
GBASSERT( flags.getFlag( 0 ) );
GBASSERT( flags.getLowestSet() == 0 );
GBASSERT( flags.getHighestSet() == 3 );
GBASSERT( flags.getNumSet() == 3 );
GBASSERT( flags.getHighestSet() >= flags.getLowestSet() );
log(LOG_DEBUG, "AWL: testing Flags 9...");
flags.setFlag( 2, 5 );
flags.setFlag( 3, false );
GBASSERT( flags.getFlag( 0 ) );
GBASSERT( 5 == flags.getFlag( 2 ) );
GBASSERT( ! flags.getFlag( 3 ) );
GBASSERT( flags.getLowestSet() == 0 );
GBASSERT( flags.getHighestSet() == 2 );
GBASSERT( flags.getNumSet() == 3 );
GBASSERT( flags.getHighestSet() >= flags.getLowestSet() );
log(LOG_DEBUG, "AWL: testing Flags 10...");
flags.reset();
GBASSERT( flags.getNumFlags() == 5 );
for ( int32_t i = 0; i < flags.getNumFlags(); i++ ) {
GBASSERT( ! flags.getFlag( i ) );
}
GBASSERT( flags.getLowestSet() == flags.NoMin );
GBASSERT( flags.getHighestSet() == flags.NoMax );
GBASSERT( flags.getNumSet() == 0 );
log(LOG_DEBUG, "AWL: Testing Flags 11...");
flags.setFlag( 0, true );
flags.setFlag( 2, 0x33 );
flags.setFlag( 4, true );
GBASSERT( flags.getFlag( 0 ) );
GBASSERT( ! flags.getFlag( 1 ) );
GBASSERT( 0x33 == flags.getFlag( 2 ) );
GBASSERT( ! flags.getFlag( 3 ) );
GBASSERT( flags.getFlag( 4 ) );
GBASSERT( flags.getLowestSet() == 0 );
//.........这里部分代码省略.........