• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ set_level函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: update_plot_data

void Widget::refreshPlot()
{
    if(initializing)
        return;

    model->fill_data();  
    findChild<QLineEdit*>("fermiLevelLineEdit")->setText(QString::number(model->get_fermi_level_eV(), 'f', 6));
    update_plot_data();
    mainCurve->setSamples(plotData.xs, plotData.ys);

    double Ev = 0;
    double Ec = Ev + model->get_Eg_eV();

    double xmin = mainCurve->minXValue();
    double xmax = mainCurve->maxXValue();
    set_level(EvCurve, Ev, xmin, xmax);
    set_level(EcCurve, Ec, xmin, xmax);
    set_level(EaCurve, Ev + model->get_Ea_eV(), xmin, xmax);
    set_level(EdCurve, Ec - model->get_Ed_eV(), xmin, xmax);
    set_level(fermiLevelCurve, Ev + model->get_fermi_level_eV(), xmin, xmax);

    QwtPlot* plotArea = findChild<QwtPlot*>("plotArea");
    plotArea->setAxisTitle(QwtPlot::xBottom, xAxisTitle);
    plotArea->setAxisTitle(QwtPlot::yLeft, yAxisTitle);
    plotArea->replot();
}
开发者ID:NIA,项目名称:semiconductor,代码行数:26,代码来源:widget.cpp


示例2: test_hasspell

void test_hasspell(CuTest * tc)
{
  spell *sp;
  struct unit * u;
  struct faction * f;
  struct region * r;

  test_cleanup();
  test_create_world();
  r = findregion(0, 0);
  f = test_create_faction(0);
  f->magiegebiet = M_TYBIED;
  u = test_create_unit(f, r);
  skill_enabled[SK_MAGIC] = 1;
  sp = create_spell("testspell", 0);
  sp->sptyp |= POSTCOMBATSPELL;

  unit_add_spell(u, 0, sp, 2);

  set_level(u, SK_MAGIC, 1);
  CuAssertTrue(tc, !u_hasspell(u, sp));

  set_level(u, SK_MAGIC, 2);
  CuAssertTrue(tc, u_hasspell(u, sp));

  set_level(u, SK_MAGIC, 1);
  CuAssertTrue(tc, !u_hasspell(u, sp));
}
开发者ID:UweKopf,项目名称:server,代码行数:28,代码来源:magic_test.c


示例3: test_set_post_combatspell

void test_set_post_combatspell(CuTest * tc)
{
  spell *sp;
  struct unit * u;
  struct faction * f;
  struct region * r;
  const int index = 2;

  test_cleanup();
  test_create_world();
  r = findregion(0, 0);
  f = test_create_faction(0);
  f->magiegebiet = M_TYBIED;
  u = test_create_unit(f, r);
  skill_enabled[SK_MAGIC] = 1;
  set_level(u, SK_MAGIC, 1);
  sp = create_spell("testspell", 0);
  sp->sptyp |= POSTCOMBATSPELL;

  unit_add_spell(u, 0, sp, 1);

  set_combatspell(u, sp, 0, 2);
  CuAssertPtrEquals(tc, sp, (spell *)get_combatspell(u, index));
  set_level(u, SK_MAGIC, 2);
  CuAssertIntEquals(tc, 2, get_combatspelllevel(u, index));
  set_level(u, SK_MAGIC, 1);
  CuAssertIntEquals(tc, 1, get_combatspelllevel(u, index));
  unset_combatspell(u, sp);
  CuAssertIntEquals(tc, 0, get_combatspelllevel(u, index));
  CuAssertPtrEquals(tc, 0, (spell *)get_combatspell(u, index));
}
开发者ID:UweKopf,项目名称:server,代码行数:31,代码来源:magic_test.c


示例4: setup_crew

static void setup_crew(ship *sh, struct faction *f, unit **cap, unit **crew) {
    if (!f) f = test_create_faction(NULL);
    assert(cap);
    assert(crew);
    *cap = test_create_unit(f, sh->region);
    *crew = test_create_unit(f, sh->region);
    (*cap)->ship = sh;
    (*crew)->ship = sh;
    set_level(*cap, SK_SAILING, sh->type->cptskill);
    set_level(*crew, SK_SAILING, sh->type->sumskill - sh->type->cptskill);
}
开发者ID:eressea,项目名称:server,代码行数:11,代码来源:ship.test.c


示例5: finalize

void Setup::finalize()
{
  auto default_logger = std::make_shared<spdlog::logger>("", default_sinks_.begin(), default_sinks_.end());
  default_logger->set_level(default_level_);
  spdlog::register_logger(default_logger);
  for(auto pair : levels_) {
    auto logger = std::make_shared<spdlog::logger>(pair.first, default_sinks_.begin(), default_sinks_.end());
    spdlog::register_logger(logger);
    logger->set_level(pair.second);
  }
}
开发者ID:benoitryder,项目名称:megumi,代码行数:11,代码来源:log.cpp


示例6: set_any_mode

void set_any_mode(uint8_t primary, uint8_t secondary, uint8_t *modes) {
    // primary (H1/M1/L1)
    if (primary) {
        set_level(modes[0]);
    }
    // secondary (H2/M2/L2)
    else {
        set_level(modes[secondary]);
    }
    #ifdef USE_THERMAL_REGULATION
    target_level = actual_level;
    #endif
}
开发者ID:schizobovine,项目名称:flashlights_are_hard,代码行数:13,代码来源:darkhorse.c


示例7: Initialize

	void Logger::Initialize()
	{
		std::vector<spdlog::sink_ptr> sinks;
		auto winColorSink = std::make_shared<spdlog::sinks::wincolor_stdout_sink_mt>();
		winColorSink->set_level(spdlog::level::trace);
		auto dailyFileSink = std::make_shared<spdlog::sinks::daily_file_sink_mt>("../Logs/log.txt", 0, 0);
		dailyFileSink->set_level(spdlog::level::trace);

		sinks.push_back(winColorSink);
		sinks.push_back(dailyFileSink);
		
		spdlog::register_logger(std::make_shared<spdlog::async_logger>("core", sinks.begin(), sinks.end(), 4096));
		spdlog::register_logger(std::make_shared<spdlog::async_logger>("graphics", sinks.begin(), sinks.end(), 4096));
	}
开发者ID:Theundeadwarrior,项目名称:Casiope,代码行数:14,代码来源:Logger.cpp


示例8: create

void create() {
    ::create();
    set_name("slave bee");
    set_short("slave bee");
    set_long("This slave has been punished for a wrong doing and thus "
      "is now a slave to the queen.");
    if(random(2)) 
	set_level(30);
    else set_level(35);
    if(random(2)) 
	set_gender("male");
    else set_gender("female");
    set_race("bee");
    set_body_type("insect");
    set_id(({"slave", "slave bee", "bee"}));
开发者ID:ehershey,项目名称:pd,代码行数:15,代码来源:slavebee.c


示例9: test_give_men_magicians

static void test_give_men_magicians(CuTest * tc) {
    struct give env = { 0 };
    int p;
    message * msg;

    test_setup_ex(tc);
    mt_create_error(158);
    env.f2 = env.f1 = test_create_faction(NULL);
    setup_give(&env);
    set_level(env.src, SK_MAGIC, 1);
    CuAssertPtrNotNull(tc, msg = give_men(1, env.src, env.dst, NULL));
    CuAssertStrEquals(tc, "error158", test_get_messagetype(msg));
    CuAssertIntEquals(tc, 1, env.dst->number);
    CuAssertIntEquals(tc, 1, env.src->number);
    msg_release(msg);

    p = rpeasants(env.r);
    CuAssertPtrNotNull(tc, msg = disband_men(1, env.dst, NULL));
    CuAssertStrEquals(tc, "give_person_peasants", test_get_messagetype(msg));
    CuAssertIntEquals(tc, 0, env.dst->number);
    CuAssertIntEquals(tc, p+1, rpeasants(env.r));
    msg_release(msg);

    test_teardown();
}
开发者ID:ennorehling,项目名称:eressea,代码行数:25,代码来源:give.test.c


示例10: set_level

/**
 * \brief Contructor.
 */
bear::engine::bool_level_variable_getter::bool_level_variable_getter
( const level* lvl, const std::string& var_name )
{
  set_level(lvl);
  set_name(var_name);
  set_default_value(false);
} // bool_level_variable_getter::bool_level_variable_getter()
开发者ID:LibreGames,项目名称:bear,代码行数:10,代码来源:bool_level_variable_getter.cpp


示例11: setup

void setup() {
   object obj;

   set_name("shayman");
   set_gender( "female" );
   add_adj("orc");
   add_ids("orc", "orc shayman");
   set_short("Orc shayman");
   set_long("An ugly orc shayman.  This thing looks wilder than your average " +
      "orc.");
   set_race("orc");
   set_level(10);
   set_aggressive(1);

   set_spell_chance(20);
   set_spell_damage(20);
   set_spell_message("The shayman casts a magic missile at $t.");

   set_hit_skill("combat/unarmed");
   set_skill("combat/unarmed", 50);
   set_skill("combat/defense", 100);

   obj = clone_object(DIR + "/obj/gold_staff.c");
   obj->setup();
   obj->move(this_object());
   obj = clone_object(DIR + "/obj/orc_slayer.c");
   obj->setup();
   obj->move(this_object());
   do_wield(obj);
}
开发者ID:november-kilo,项目名称:gurbalib,代码行数:30,代码来源:orc_shayman.c


示例12: strncpy

int NLog::startup( const char* _log_path, int _level, int _daemon_mode )
{
	if ( start() < 0 )
		return -1;

	if ( ! _log_path )
		return -1;
    
	strncpy( log_path_, _log_path, sizeof(log_path_) );

	daemon_mode_ = _daemon_mode;
	if( !daemon_mode_ )
	{
		for ( int i = 0; i < MAX_LOG_TYPE; i++ )
			log_[i] = stdout;
	}
	else
	{
		log_[ LOG_TYPE_FATAL ] = open_log_file( "fatal" );
		log_[ LOG_TYPE_EMERGENCY ] = open_log_file( "emergency" );
		log_[ LOG_TYPE_ERROR ] = open_log_file( "error" );
		log_[ LOG_TYPE_LOG ] = open_log_file( "log" );
		log_[ LOG_TYPE_DEBUG ] = open_log_file( "debug" );
	}

    set_level( _level );

	return 0;
}
开发者ID:jeffrey-lee,项目名称:AppleSeed,代码行数:29,代码来源:log.cpp


示例13: begin

        LoggerPtr
        LogRegistry::getOrCreateLogger(const std::string &logger_name) {
            // If logger already exists, return a copy of it
            auto spd_logger = spdlog::get(logger_name);
            if (!spd_logger) {
                // Bummer, it didn't exist. We'll create one from scratch.
                try {
                    spd_logger = spdlog::details::registry::instance().create(
                        logger_name, begin(sinks_), end(sinks_));
                    spd_logger->set_pattern(DEFAULT_PATTERN);
                    /// @todo should this level be different than other levels?
                    spd_logger->set_level(convertToLevelEnum(minLevel_));
                    spd_logger->flush_on(
                        convertToLevelEnum(DEFAULT_FLUSH_LEVEL));
                } catch (const std::exception &e) {
                    generalPurposeLog_->error()
                        << "Caught exception attempting to create logger: "
                        << e.what();
                    generalPurposeLog_->error() << "Error creating logger. "
                                                   "Will only log to the "
                                                   "console.";
                } catch (...) {
                    generalPurposeLog_->error() << "Error creating logger. "
                                                   "Will only log to the "
                                                   "console.";
                }
            }

            return Logger::makeFromExistingImplementation(logger_name,
                                                          spd_logger);
        }
开发者ID:niiashikwei,项目名称:OSVR-Core,代码行数:31,代码来源:LogRegistry.cpp


示例14: Pathname

void
EditorScreen::level_new_without_confirm()
{
  // FIXME: dialogs don't update
  level_pathname = Pathname();
  set_level(std::unique_ptr<EditorLevel>(new EditorLevel));
}
开发者ID:bugdebugger,项目名称:pingus,代码行数:7,代码来源:editor_screen.cpp


示例15: test_piracy_cmd_land_to_land

static void test_piracy_cmd_land_to_land(CuTest * tc) {
    unit *u;
    region *r;
    faction *f;
    int target;
    const terrain_type *t_plain;
    const ship_type *stype;

    test_setup();
    setup_piracy();
    t_plain = get_or_create_terrain("plain");
    stype = test_create_shiptype("boat");

    /* create a target: */
    r = test_create_region(0, 0, t_plain);
    f = test_create_faction(NULL);
    u = test_create_unit(f, r);
    u->ship = test_create_ship(r, stype);
    target = f->no;

    /* create a pirate: */
    r = test_create_region(1, 0, t_plain);
    f = test_create_faction(NULL);
    u = test_create_unit(f, r);
    u->ship = test_create_ship(r, stype);
    set_level(u, SK_SAILING, u->ship->type->sumskill);
    u->thisorder = create_order(K_PIRACY, f->locale, "%s", itoa36(target));

    piracy_cmd(u);
    CuAssertPtrEquals(tc, NULL, u->thisorder);
    CuAssertPtrEquals(tc, r, u->region);

    test_teardown();
}
开发者ID:ennorehling,项目名称:eressea,代码行数:34,代码来源:piracy.test.c


示例16: test_piracy_cmd

static void test_piracy_cmd(CuTest * tc) {
    faction *f;
    region *r;
    unit *u, *u2;
    terrain_type *t_ocean;
    ship_type *st_boat;

    test_setup();
    setup_piracy();

    t_ocean = get_or_create_terrain("ocean");
    st_boat = st_get_or_create("boat");
    u2 = test_create_unit(test_create_faction(NULL), test_create_region(1, 0, t_ocean));
    assert(u2);
    u_set_ship(u2, test_create_ship(u2->region, st_boat));
    u = test_create_unit(f = test_create_faction(NULL), r = test_create_region(0, 0, t_ocean));
    assert(f && u);
    set_level(u, SK_SAILING, st_boat->sumskill);
    u_set_ship(u, test_create_ship(u->region, st_boat));
    f->locale = get_or_create_locale("de");
    u->thisorder = create_order(K_PIRACY, f->locale, "%s", itoa36(u2->faction->no));

    piracy_cmd(u);
    CuAssertPtrEquals(tc, NULL, u->thisorder);
    CuAssertTrue(tc, u->region != r);
    CuAssertPtrEquals(tc, u2->region, u->region);
    CuAssertPtrEquals(tc, u2->region, u->ship->region);
    CuAssertPtrNotNullMsg(tc, "successful PIRACY sets attribute", r->attribs); /* FIXME: this is testing implementation, not interface */
    CuAssertPtrNotNullMsg(tc, "successful PIRACY message", test_find_messagetype(f->msgs, "piratesawvictim"));
    CuAssertPtrNotNullMsg(tc, "successful PIRACY movement", test_find_messagetype(f->msgs, "shipsail"));

    test_teardown();
}
开发者ID:ennorehling,项目名称:eressea,代码行数:33,代码来源:piracy.test.c


示例17: test_dragon_attacks_the_rich

static void test_dragon_attacks_the_rich(CuTest * tc)
{
    faction *f, *f2;
    region *r;
    unit *u, *m;
    const item_type *i_silver;

    init_language();
    create_monsters(&f, &f2, &r, &u, &m);

    guard(m, GUARD_TAX);
    set_level(m, SK_WEAPONLESS, 10);

    rsetmoney(r, 1);
    rsetmoney(findregion(1, 0), 0);
    i_silver = it_find("money");
    assert(i_silver);
    i_change(&u->items, i_silver, 5000);

    config_set("rules.monsters.attack_chance", "0.00001");

    plan_monsters(f2);

    CuAssertPtrNotNull(tc, find_order("ATTACKIERE 1", m));
    CuAssertPtrNotNull(tc, find_order("PLUENDERE", m));
    test_cleanup();
}
开发者ID:stm2,项目名称:server,代码行数:27,代码来源:monsters.test.c


示例18: GOOGLE_CHECK_NE

void UpdateUserInfo::MergeFrom(const UpdateUserInfo& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_level()) {
      set_level(from.level());
    }
    if (from.has_experience()) {
      set_experience(from.experience());
    }
    if (from.has_wincount()) {
      set_wincount(from.wincount());
    }
    if (from.has_winrate()) {
      set_winrate(from.winrate());
    }
    if (from.has_successionwincount()) {
      set_successionwincount(from.successionwincount());
    }
    if (from.has_incomgolds()) {
      set_incomgolds(from.incomgolds());
    }
    if (from.has_bureauexperience()) {
      set_bureauexperience(from.bureauexperience());
    }
  }
}
开发者ID:wanggan768q,项目名称:GameWork,代码行数:26,代码来源:BattleResult.pb.cpp


示例19: create_object

void create_object(void)
{
  set_name("andalf");
  add_id("fisherman");
  add_id("man");
  set_short("Andalf the Fisherman, sitting on a bench");
  set_level(4);
  set_hp(150);
  set_wc(5);
  set_new_ac(10);
  set_skill("combat",30);
  set_skill("unarmed",30);
  set_al(20);
  set_gender(1);
  set_race("human");
  set_long("This is Andalf the old fisherman of Newbie Island. He looks "+
           "just as old and grumpy as every other fisherman you will come "+
           "across in the kingdoms. He sure looks as if he could tell some "+
           "tales about fishing, though. Perhaps if you asked him about "+
           "fishing, he would tell you a fish tale?\n");

  load_chat(5,({"Andalf grumbles: Damn I'm sick of this island.\n",
                "Andalf grumbles: The most important thing for a fisherman "+
                "is the ability to tell a damn fish tale.\n",
                "Andalf grumbles something incomprehensible.\n",
                "Andalf grumbles: You can raise yer damn lore skill here.\n"
                }));
开发者ID:yodakingdoms,项目名称:kingdoms,代码行数:27,代码来源:fisherman.c


示例20: create_object

void create_object(void)
{
    ::create_object();
    set_name("guard");
    add_id("dungeon guard");
    set_short("a darkling dungeon guard");
    set_long("One of the guards responsible for guarding the dungeons. " +
             "His skin is pale and his small, black eyes lack pupils. Two " +
             "long teeth protrude from his lower jaw. He stands there in " +
             "silence, observing your every move.\n");
    set_level(16);
    set_unarmed(0);
    set_db(3);
    set_hp(240);
    set_skill("combat",90);
    set_skill("longblade",90);
    set_skill("resist",90);
    set_skill("perception",90);
    set_wc(1);
    set_new_ac(1);
    add_money(random(400));

    make(ARMOUR + "dark_plate");
    make(WEAPON + "dark_bastsword");
    make(ARMOUR + "dark_lshield");
    make(ARMOUR + "dark_phelmet");
    make(ARMOUR + "dark_cloak");
    make(ARMOUR + "dark_glove");
    make(ARMOUR + "dark_boot");
    make(ARMOUR + "dark_amulet");
    init_command("wear all");
    init_command("wield sword");

    load_a_chat(15,({ "The dungeon guard tries to bite you!\n" }));
开发者ID:yodakingdoms,项目名称:kingdoms,代码行数:34,代码来源:darkling_dung_guard.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ set_light函数代码示例发布时间:2022-05-30
下一篇:
C++ set_length函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap