当前位置: 首页>>代码示例>>C++>>正文


C++ setLevel函数代码示例

本文整理汇总了C++中setLevel函数的典型用法代码示例。如果您正苦于以下问题:C++ setLevel函数的具体用法?C++ setLevel怎么用?C++ setLevel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了setLevel函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: table

ERR_Code
aCatGroup::SetParent( aCatGroup * parent )
{
	aSQLTable * t = table();
	if ( !t ) return err_notable;
	qulonglong idp = 0, uid = getUid();
	if ( parent ) idp = parent->getUid();
	if ( idp == uid ) return err_cyclereparent;
	qulonglong level, tmpid = idp;
	aCatGroup tg( obj, db );
	while ( tmpid )
	{
		tg.select(tmpid);
		tmpid = tg.parentUid();
		if ( tmpid == uid ) return err_cyclereparent;
	}
	QString query;
	query = QString("UPDATE %1 SET idp=%2 WHERE id=%3").arg(t->tableName).arg(idp).arg(uid);
	level = parent->Value("Level").toULongLong();
//	printf("%s\n",(const char*)query);
	QSqlDatabase tdb = *db->db();
	tdb.exec(query);
	if ( !tdb.lastError().type() )
	{
		if (idp) setLevel(level+1);
		else setLevel(0);
		return err_noerror;
	}
	else return err_execerror;
}
开发者ID:K-Be,项目名称:ananas-labs-qt4,代码行数:30,代码来源:acatalogue.cpp

示例2: debugString

void Dmc3xlTimeline::onTimer(Timer *sender)
{
#ifdef DEBUG
    debugString("Dmc3xlTimeline::onTimer");
    debug(sender->id);
#endif
    switch (sender->id)
    {
    case TIMER_SWITCH_UP:
        sendSwitchUp();
        setLedDuration(ledRight, 1, 100);
        break;
    case TIMER_SWITCH_DOWN:
        sendSwitchDown();
        setLedDuration(ledLeft, 1, 100);
        break;
    case TIMER_LEVEL_UP:
        setLevel();
        sendLevel();
        setLedDuration(ledRight, 1, 100);
        break;
    case TIMER_LEVEL_DOWN:
        setLevel();
        sendLevel();
        setLedDuration(ledLeft, 1, 100);
        break;
    }
}
开发者ID:jfis,项目名称:dmc3xl_timeline,代码行数:28,代码来源:Dmc3xlTimeline.cpp

示例3: if

void OgreApp::activatePerformSingleTap(float x, float y)
{
    player->addAction(ACTION_SINGLE_TAP);
    if (x >= globals.pauseButton_posX && x <= globals.pauseButton_posX + globals.pauseButton_width &&
        y >= globals.pauseButton_posY && y <= globals.pauseButton_posY + globals.pauseButton_posY) {
        if (!pause) setPause(true);
    }
#ifdef DEBUG_MODE
    else if (y <= 100 && x <= globals.screenWidth / 2) {
        setLevel(EVEN, false);
    } else if (y <= 100 && x > globals.screenWidth / 2) {
        setLevel(EVEN);
    }
#endif
}
开发者ID:animekraxe,项目名称:brain-game,代码行数:15,代码来源:OgreApp.cpp

示例4: setLinesCompleted

void Game::updateGameInfos(int nbLinesDeleted)
{
	setLinesCompleted(getLinesCompleted() + nbLinesDeleted);
	setLevel(computeLevel());
	setFallIterationDelay(computeFallIterationDelay());
	setScore(computeScore(nbLinesDeleted) + getScore());
}
开发者ID:Shiryu,项目名称:Flocks,代码行数:7,代码来源:game.cpp

示例5: setLevel

void Level::update(double delta, sf::Event& evt, sf::View& v)
{

	if(ltype == Menu)
	{
		//if spacebar is pressed in menu, start game
		if(evt.type == sf::Event::KeyPressed)
			if(evt.key.code == sf::Keyboard::Space)
				setLevel(Stage1);
	} else {
		//step an iteration of box2d world
		b2world->Step(delta/1000, 8, 3);

		//set view
		//remember to change from first dynamic entity to the player position
		
		v.setCenter(player->anim.xpos+20, player->anim.ypos+30);

		//iterate through dentity list and update
		auto itr = dentitylist.begin();
		for(itr; itr != dentitylist.end(); ++itr)
		{
			(*itr)->update(delta);
		}
	
		//update player
		player->Player::update(evt, delta);

		//update enemies
	}
}
开发者ID:imageprocessing,项目名称:sfml-workingtitle,代码行数:31,代码来源:Level.cpp

示例6: stringToLogLevel

std::vector<std::string> LoggerDB::processConfigString(
    folly::StringPiece config) {
  std::vector<std::string> errors;
  if (config.empty()) {
    return errors;
  }

  std::vector<StringPiece> pieces;
  folly::split(",", config, pieces);
  for (const auto& p : pieces) {
    auto idx = p.rfind('=');
    if (idx == folly::StringPiece::npos) {
      errors.emplace_back(
          folly::sformat("missing '=' in logger configuration: \"{}\"", p));
      continue;
    }

    auto category = p.subpiece(0, idx);
    auto level_str = p.subpiece(idx + 1);
    LogLevel level;
    try {
      level = stringToLogLevel(level_str);
    } catch (const std::exception&) {
      errors.emplace_back(folly::sformat(
          "invalid log level \"{}\" for category \"{}\"", level_str, category));
      continue;
    }

    setLevel(category, level);
  }

  return errors;
}
开发者ID:Orvid,项目名称:folly,代码行数:33,代码来源:LoggerDB.cpp

示例7: DevLog

	DevLog()
	{
		addChannel( MSG_DEV );
		setLevel( 3 );

		pos = 0;
	}
开发者ID:uvbs,项目名称:GameProject,代码行数:7,代码来源:WorldEditor.cpp

示例8: setLevel

bool Level6::initWithDifficulty(int difficulty)
{
    if ( !Layer::init() )
    {
        return false;
    }

	SpriteFrameCache::getInstance()->addSpriteFramesWithFile("sprite_level6-hd.plist");
	SpriteFrameCache::getInstance()->addSpriteFramesWithFile("sprite_level6_2-hd.plist");
	setLevel(6);
	this->difficulty = difficulty;
	initMap();
	
	std::vector<Point> points;
	points.push_back(Point(40,360));
	points.push_back(Point(40,610));
	points.push_back(Point(756,940));
	points.push_back(Point(1145,560));
	addWaveProgressBars(points);
	waveFlags.at(0)->restartWaveFlag();
	waveFlags.at(1)->restartWaveFlag();
	waveFlags.at(2)->restartWaveFlag();
	waveFlags.at(3)->restartWaveFlag();
	SoundManager::playJungleBattle();
	return true;
}
开发者ID:KrisLee,项目名称:KingdomRush,代码行数:26,代码来源:Level6.cpp

示例9: setLevel

void Logger::configure(std::string level,std::string format,std::string filename){

  _filename = filename;
  _format = format;
  _enabled = true;
  setLevel(level);
}
开发者ID:iansimonson,项目名称:Logger,代码行数:7,代码来源:logger.cpp

示例10: setScope

bool ArrowTower::init()
{
	if (!TowerBase::init())
	{
		return false;
	}

	setScope(120);
	setLethality(1);
	setTowerValue(120);
	setRate(3);
	setLevel(0);
	setTowerType(0);



	auto ll = getLevel();
	if( ll == 0 )
	{
		tower= Sprite::createWithSpriteFrameName("tower1.png");
	}
	else if ( ll == 1)
	{
		tower= Sprite::createWithSpriteFrameName("tower2.png");
	}
	else 
	{
		tower= Sprite::createWithSpriteFrameName("tower3.png");
	}
	this->addChild(tower);
	schedule(schedule_selector(ArrowTower::rotateAndShoot), 0.8f);
	return true;
}
开发者ID:HHopToad,项目名称:TD,代码行数:33,代码来源:ArrowTower.cpp

示例11: qDebug

void GameScene::setGameState(GameState gameState) {
    qDebug() << "Game state set " << gameState;
    // If the gameState was game over, restart the level
    if(m_gameState == GameOver && gameState == GameRunning) {
        setLevel(level());
    }
    this->m_gameState = gameState;
    if(gameState == GameStarted) {
        pauseGame();
    }
    if(gameState == GamePaused) {
        pauseGame();
    }
    if(gameState == GameOver) {
        pauseGame();
    }
    if(gameState == GameRunning) {
        setLevelUpgrade(false);
        continueGame();
    }
    if(gameState == GameInstructionPause) {
        pauseGame();
    }
    emit gameStateChanged(gameState);
}
开发者ID:dragly,项目名称:nanoparticles,代码行数:25,代码来源:gamescene.cpp

示例12: Item

Spawn::Spawn(Spawn& s, uint16_t id)
  : Item(tSpawn, id)
{
  setName(s.name());
  setLastName(s.lastName());
  Item::setPoint(s.x(), s.y(), s.z());
  setPetOwnerID(s.petOwnerID());
  setLight(s.light());
  setGender(s.gender());
  setDeity(s.deity());
  setRace(s.race());
  setClassVal(s.classVal());
  setHP(s.HP());
  setMaxHP(s.maxHP());
  setGuildID(s.GuildID());
  setLevel(s.level());
  for (int i = 0; i <= tLastCoreWearSlot; i++)
    setEquipment(i, s.equipment(i));
  setEquipment(tUnknown1, 0);
  setTypeflag(s.typeflag());
  setNPC(s.NPC());
  setAnimation(s.animation());
  setDeltas(s.deltaX(), s.deltaY(), s.deltaZ());
  setHeading(s.heading(), s.deltaHeading());
  setConsidered(s.considered());

  // the new copy will own the spawn track list
  m_spawnTrackList.setAutoDelete(false);
  m_spawnTrackList = s.m_spawnTrackList;
  s.m_spawnTrackList.setAutoDelete(false);
  m_spawnTrackList.setAutoDelete(true);
}
开发者ID:xbackupx,项目名称:showeqx,代码行数:32,代码来源:spawn.cpp

示例13: setLevel

void Pokemon::levelUpTo(int level)
{
	for (auto currentLevel = level_; currentLevel <= level - 1;)
	{
		setLevel(++currentLevel, false);
	}
}
开发者ID:Metalmate,项目名称:CPP-ALG,代码行数:7,代码来源:Pokemon.cpp

示例14: switch

void OgreApp::activatePerformLeftMove()
{
    player->addAction(ACTION_SWIPE_LEFT);
    switch (gameState)
    {
        case STATE_PLAY:
        {
            if (pause)
            {
                setPause(false);
            }
            else
            {
                if (player->setVineDirRequest(Util::rightOf(player->getVineDest())) && !tunnel->isDone())
                {
                    float val = player->getDesireRoll();
                    player->setDesireRoll(val + 45);
                }
                globals.moveLeft = true;
            }
            break;
        }
        case STATE_PROMPT:
        {
            gameState = STATE_PLAY;
            levelMgr->repeatPreviousPhase();
            setLevel();
            break;
        }
    }
}
开发者ID:animekraxe,项目名称:brain-game,代码行数:31,代码来源:OgreApp.cpp

示例15: main

int main()
{
  // check logger performance for 'NULL configuration'
  logger::registry().registerHandle(logger::makeLoggerRegistryHandle());
  auto logger = logger::registry()->registerLogger("");
  //logger->setMessageService(std::make_shared< logger::NullMessageService >());
  auto messageService = std::make_shared< logger::StdOutMessageService >();
  logger->setMessageService(messageService);
  logger->setLevel(logger::MessageLevel::DEBUG);

  auto start = std::chrono::high_resolution_clock::now();
  const auto COUNT = 100; // a hundred million
  for (auto i = 0; i < COUNT; ++i)
  {
    LOG_DEBUG("debug message no: %d", i);
    LOG_ERROR("error message no: %d", i);
  }
  messageService->flush();
  auto end = std::chrono::high_resolution_clock::now();

  auto duration = end - start;
  std::chrono::duration<float> seconds = duration;// std::chrono::duration_cast<std::chrono::seconds>(duration);

  auto msPerLine = std::chrono::duration_cast<std::chrono::nanoseconds>(duration) / COUNT;
  printf("work time: %f sec [%lld ns * %d]\n", seconds.count(), msPerLine.count(), COUNT);

  return 0;
}
开发者ID:jjasinski,项目名称:Logger_old,代码行数:28,代码来源:simple.cpp


注:本文中的setLevel函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。