本文整理汇总了C++中setLevel函数的典型用法代码示例。如果您正苦于以下问题:C++ setLevel函数的具体用法?C++ setLevel怎么用?C++ setLevel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setLevel函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: getLevel
//returns whether the level goes up
bool PropertyStorage::recomputeLevel(LocationProperty inNode)
{
int32_t l = getLevel(inNode);
int32_t newL = calcLevel(inNode);
setLevel(inNode, newL);
return newL > l;
}
开发者ID:WantonSoup,项目名称:ufora,代码行数:8,代码来源:PropertyStorage.cpp
示例17: main
void main()
{
try
{
logger::registry().registerHandle(logger::makeLoggerRegistryHandle());
// initialize of the logger registry
// configuration
auto logger = logger::registry()->registerLogger("moduleName");
logger->setLevel(logger::MessageLevel::DEBUG);
auto nullMessageService = std::make_shared< logger::NullMessageService >();
auto stdOutMessageService = std::make_shared< logger::StdOutMessageService >();
logger->setMessageService(nullMessageService);
logger->setMessageService(stdOutMessageService);
// usage
logger->debug(LOGGER_CALL_INFO);
logger->debug(LOGGER_CALL_INFO, "simple message");
logger->debug(LOGGER_CALL_INFO, "complex message: %s", "ala ma kota");
//auto logger2 = logger::registry()->getLogger("");
//logger->debug(logger::);
// free of the logger registry (better to do it)
logger::registry().unregisterHandle();
}
catch (const std::exception& e)
{
printf("catch exception: %s\n", e.what());
}
}
开发者ID:jjasinski,项目名称:Logger_old,代码行数:35,代码来源:main.cpp
示例18: setLevel
bool Level10::initWithDifficulty(int difficulty)
{
if ( !Layer::init() )
{
return false;
}
SpriteFrameCache::getInstance()->addSpriteFramesWithFile("sprite_level10-hd.plist");
SpriteFrameCache::getInstance()->addSpriteFramesWithFile("sprite_level10_2-hd.plist");
setLevel(10);
this->difficulty = difficulty;
initMap();
MyAnimation::getInstance()->init_BossCanibal();
std::vector<Point> points;
points.push_back(Point(610,710));
points.push_back(Point(650,710));
addWaveProgressBars(points);
waveFlags.at(0)->restartWaveFlag();
waveFlags.at(1)->restartWaveFlag();
Vector<SpriteFrame*> animFrames1;
SpriteFrame* frame1=NULL;
for (int i = 1; i <= 31; i++)
{
frame1 = SpriteFrameCache::getInstance()->getSpriteFrameByName(String::createWithFormat("Stage10_Tower_00%02d.png",i)->getCString());
if(frame1!=nullptr)
animFrames1.pushBack(frame1);
}
AnimationCache::getInstance()->addAnimation(Animation::createWithSpriteFrames(animFrames1, 0.04f),"level_stage");
SoundManager::playJungleBattle();
return true;
}
开发者ID:swordlegend,项目名称:KingdomRush,代码行数:30,代码来源:Level10.cpp
示例19: setLevel
bool Level12::initWithDifficulty(int difficulty)
{
if ( !Layer::init() )
{
return false;
}
SpriteFrameCache::getInstance()->addSpriteFramesWithFile("sprite_Level12-hd.plist");
SpriteFrameCache::getInstance()->addSpriteFramesWithFile("sprite_Level12_2-hd.plist");
setLevel(12);
this->difficulty = difficulty;
initMap();
std::vector<Point> points;
points.push_back(Point(450,800));
points.push_back(Point(40,300));
points.push_back(Point(1091,710));
addWaveProgressBars(points);
waveFlags.at(0)->restartWaveFlag();
waveFlags.at(1)->restartWaveFlag();
waveFlags.at(2)->restartWaveFlag();
SoundManager::playDesertBattle();
return true;
}
开发者ID:KrisLee,项目名称:KingdomRush,代码行数:25,代码来源:Level12.cpp
示例20: initTowerBase
Tower_Shit::Tower_Shit(Node*scene, Vec2 pos, int lev)
{
view_click = 0;
count = 0;
cos_upgrade = 220;
this->level = lev;
initTowerBase();
effect = 0;
sprite = Sprite::createWithSpriteFrameName("Shit11.png");
sprite;;
sprite_base = MenuItemSprite::create(Sprite::createWithSpriteFrameName("Shit-11.png"), Sprite::createWithSpriteFrameName("Shit-11.png")
, [=](Ref*p)
{
if (view_click == 0)
{
((Scene_UI*)scene)->view_click_gloal->setAllVisFalse();
view_click = new View_Click_Tower(2, this);
}
});
sprite_base->setPosition(pos);
sprite_base;;
auto ss = Menu::create(sprite_base, nullptr);
ss->setPosition(0, 0);
scene->addChild(ss);
scene->addChild(sprite);
sprite->setPosition(pos);
sprite_upgrade = Sprite::createWithSpriteFrameName("showupgrade02.png");
scene->addChild(sprite_upgrade);
sprite_upgrade->setPosition(sprite->getPositionX(), sprite->getPositionY() + sprite->getContentSize().height);
auto ani2 = Animation::create();
ani2->addSpriteFrame(SpriteFrameCache::getInstance()->getSpriteFrameByName("showupgrade02.png"));
ani2->addSpriteFrame(SpriteFrameCache::getInstance()->getSpriteFrameByName("showupgrade01.png"));
ani2->setDelayPerUnit(0.1);
ani2->setRestoreOriginalFrame(false);
ani2->setLoops(-1);
sprite_upgrade->runAction(Animate::create(ani2));
sprite_upgrade->setVisible(false);
setLevel(lev);
}
开发者ID:dreamyouxi,项目名称:Defend,代码行数:59,代码来源:Tower_Shit.cpp
注:本文中的setLevel函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论