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

C++ set_weight函数代码示例

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

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



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

示例1: setup

void setup() {
   set_name( "bear" );
   set_desc( "a furry bear" );
   set_height( 200 );
   set_weight( 8000 );

   set_stats( ({ 6, 4, -2, 8, -4 }) );
开发者ID:Yuffster,项目名称:discworld_distribution_mudlib,代码行数:7,代码来源:bear.c


示例2: create

void create() {
   ::create();
   set_gender( random(2)+1 );
/* OBJEDIT { */
   set_spd( 11 );
   set_con( 4 );
   set_str( 4 );
   set_dex( 14 );
   set_wil( 9 );
   set_cha( 15 );
   set_int( 3 );
   set_emp( 5 );
   set_distant( "a rat" );
   set_specific( "the rat" );
   set_look( "It's a rat, a large, furry pest known for spreading disease and stealing grain. ~Pron is $(HP)." );
   set_plural( "rats" );
   set_name( "rat" );
   set_type( "rodent" );
   set_droppable( 1 );
   set_weight( 3000 );
/* } OBJEDIT */

   set_living_name( name );

   set_food(query_food_capacity());
   set_drink(query_drink_capacity());

   set_product_aspect( C_RAT );
   add_product( C_MEAT, 3, 10 );
   add_product( C_PELT, 2, 20 );
   //add_product( C_TAIL, 1, 10 );

   set_known_forms( (["animal": ({ "bite", "dodge"}) ]) );
开发者ID:shentino,项目名称:simud,代码行数:33,代码来源:rat.c


示例3: set_hashMin

void CRedisProxyCfg::set_groupAttribute(TiXmlAttribute *groupAttr, CGroupInfo& pGroup) {
    for (; groupAttr != NULL; groupAttr = groupAttr->Next()) {
        const char* name = groupAttr->Name();
        const char* value = groupAttr->Value();
        if (value == NULL) value = "";
        if (0 == strcasecmp(name, "hash_min")) {
            set_hashMin(pGroup, atoi(value));
            continue;
        }
        if (0 == strcasecmp(name, "hash_max")) {
            set_hashMax(pGroup, atoi(value));
            continue;
        }
        if (0 == strcasecmp(name, "weight")) {
            set_weight(pGroup, (unsigned int)atoi(value));
            continue;
        }

        if (0 == strcasecmp(name, "name")) {
            set_groupName(pGroup, value);
            continue;
        }
        if (0 == strcasecmp(name, "policy")) {
            memcpy(pGroup.m_groupPolicy, value, strlen(value)+1);
            continue;
        }
    }
}
开发者ID:SimpleDays,项目名称:onecache,代码行数:28,代码来源:redis-proxy-config.cpp


示例4: set_weight

void t_combat_ai_ranged_area_action::weigh_action(class t_combat_ai const& owner)
{
	if (has_been_weighed())
		return;

	t_battlefield &battlefield = m_battlefield;

	t_combat_creature const& attacker = owner.get_actor();

	t_combat_creature_set const&	affected_list = m_point->get_affected_list();
	double							total = 0.0;
		
	for (t_combat_creature_set::const_iterator affected_iterator = affected_list.begin(); affected_iterator != affected_list.end(); affected_iterator++)
	{
		const t_combat_creature &affected = **affected_iterator;
	
		int damage = attacker.get_ranged_damage( affected, 0, 0 );
		double weight = affected.get_ai_value( damage );

		weight += t_combat_ai::get_zoc_change_weight(damage, affected, false, 0);

		if (affected.belongs_to_defender() == attacker.get_controller())
		{
			weight *= -weight;
		}

		total += weight;
	}
	set_weight( total );
}
开发者ID:sundoom,项目名称:sunstudio,代码行数:30,代码来源:combat_ai_ranged_area_action.cpp


示例5: set_values_channel

static ssize_t set_values_channel(struct kobject *kobj,
				  struct kobj_attribute *attr, const char *buf,
				  size_t count)
{
	struct hidma_chan_attr *chattr;
	struct hidma_mgmt_dev *mdev;
	unsigned long tmp;
	int rc;

	chattr = container_of(attr, struct hidma_chan_attr, attr);
	mdev = chattr->mdev;

	rc = kstrtoul(buf, 0, &tmp);
	if (rc)
		return rc;

	if (strcmp(attr->attr.name, "priority") == 0) {
		rc = set_priority(mdev, chattr->index, tmp);
		if (rc)
			return rc;
	} else if (strcmp(attr->attr.name, "weight") == 0) {
		rc = set_weight(mdev, chattr->index, tmp);
		if (rc)
			return rc;
	}
	return count;
}
开发者ID:01org,项目名称:thunderbolt-software-kernel-tree,代码行数:27,代码来源:hidma_mgmt_sys.c


示例6: create

//pyro && kumi
void create() {
 ::create();
 set_name("star");
 set_short("%^BOLD%^%^BLACK%^N%^RESET%^i%^BOLD%^%^BLACK%^n%^RESET%^j%^BOLD%^%^BLACK%^a%^ %^RESET%^S%^BOLD%^%^BLACK%^t%^RESET%^a%^BOLD%^%^BLACK%^r%^RESET%^");
 set_long("%^BOLD%^%^BLACK%^This Ninja Star would be quite deadly in the hands of a skilled assassin.%^RESET%^");
 set_weight(10);
 set_id( ({ "star", "Ninja star"}) );
开发者ID:ehershey,项目名称:pd,代码行数:8,代码来源:ninja_star.c


示例7: create

void create() {
   object ob;
   ::create();
   set_gender( random(2)+1 );
/* OBJEDIT { */
   set_str( 18 );
   set_dex( 10 );
   set_con( 24 );
   set_spd( 20 );
   set_wil( 4 );
   set_int( 4 );
   set_emp( 4 );
   set_cha( 4 );
   set_distant( "a fire lizard" );
   set_specific( "the fire lizard" );
   set_look( "~Name ~verbis small and red with a wingspan no greater than about a meter. ~Pron occasionally emits a small puff of smoke from ~poss nostrils. ~Pron is $(HP)." );
   set_alt_name( "fire lizard" );
   set_alt_plural( "fire lizards" );
   set_plural( "lizards" );
   set_name( "lizard" );
   set_type( "animal" );
   set_droppable( 1 );
   set_weight( 12000 );
/* } OBJEDIT */

   set_living_name( name );

   set_food(query_food_capacity()/2);
   set_drink(query_drink_capacity()/2);

   set_known_forms( (["dragon": ({"dragon_bite","dragon_hide"}) ]) );
开发者ID:shentino,项目名称:simud,代码行数:31,代码来源:fire_lizard.c


示例8: create_object

void create_object(void)
{
    set_name("sail");
    add_id("gaff sail");
    add_id("_pirate_quest_gaff_sail_");
    set_short("A gaff sail");
    set_long("A sail with four corners and four edges.\n");
    set_weight(4);
    set_value(75);

    add_lore("Schooners are usually rigged with gaff sails, and most " +
             "square rigged vessels have a gaff sail on their aft mast " +
             "called the spanker. Above the gaff is often rigged a " +
             "triangular sail called a gaff topsail.\n",5);
    add_lore("A gaff sail is a fore-and-aft sail with four corners and " +
             "four edges. The lowest edge is called the foot and is " +
             "attached to a horizontal spar called a boom. The vertical " +
             "edge that is attached to the mast is called the luff. The " +
             "upper edge is called the head and is attached to a spar " +
             "called a gaff. The remaining edge is the leech. The corner " +
             "between the luff and the head is called the throat, between " +
             "the head and the leech is the peak, between the leech and " +
             "the foot is the clew, and the remaining corner is called " +
             "the tack.\n",10);
    set_material("canvas"); //Angelwings
}
开发者ID:yodakingdoms,项目名称:kingdoms,代码行数:26,代码来源:gaff_sail.c


示例9: create

void create() {
   object ob;

::create();

   if (!clonep(this_object())) {
     return; /* blueprints don't get stuff */
   }

   set_gender( random(2)+1 ); // both male and female guards
/* OBJEDIT { */
   set_distant( "a captain" );
   set_specific( "the ship captain" );
   set_look( "~Name ~verbis one of the captains of the 3 ships. ~Pron ~verbstand watch against rowdy passengers and stowaways. ~Pron ~verbis ?(ISCLOTHED:wearing $(WORN)):(unclothed), and ~verbis holding $(HELD). ~Pron ~verbis $(HP)." );
   set_alt_name( "ship captain" );
   set_alt_plural( "captain" );
   set_plural( "captains" );
   set_name( "captain" );
   set_type( "human" );
   set_droppable( 1 );
   set_weight( 60000 );
/* } OBJEDIT */

   set_living_name( name );

   set_known_forms( (["sword": ({"slash","stab","dodge","parry"}),
                      "brawl": ({"punch","dodge"}) ]) );
开发者ID:shentino,项目名称:simud,代码行数:27,代码来源:ship_captain.c


示例10: setup

void setup() {
   set_name( "beetle" );
   set_desc( "a hard-carapaced insect that scuttles along the ground" );
   set_height( 5 );
   set_weight( 2 );

   add_bit( "left wing cover", "cover", ({ "thorax", 1, 0 }) );
开发者ID:Yuffster,项目名称:discworld_distribution_mudlib,代码行数:7,代码来源:beetle.c


示例11: create

void create() {
    ::create();
        set_name("sharp axe");
        set_short("Sharp Axe");
        set_long("This axe has a very short handle, the blade of the axe looks razor sharp.");
        set_weight(12);
        set_id( ({ "axe", "sharp axe" }) );
开发者ID:ehershey,项目名称:pd,代码行数:7,代码来源:md-axe.c


示例12: Restraint

IMPISD_BEGIN_NAMESPACE

LogWrapper::LogWrapper(Model *m, double weight,
                       const std::string &name)
  : Restraint(m, name) {
  set_weight(weight);
}
开发者ID:AljGaber,项目名称:imp,代码行数:7,代码来源:LogWrapper.cpp


示例13: create

void create() {
  ::create();
  switch (random(4)) {
    case 0:
    case 3:
      set_short("a breadfruit");
      set_long("This round, green, bumpy fruit has fallen "
	       "from one of the trees. Its skin is still intact however, "
	       "so it should be fine to eat.");
      set_id( ({ "breadfruit", "bread fruit", "fruit", "bread" }) );
      set_strength(20);
      set_my_mess("You crack open the raw breadfruit and "
	          "manage to eat some of the starchy fruit.");
      set_your_mess("$N cracks open a breadfruit and manages to "
	            "eat some of the starchy fruit.");
      set_taste("default", "The bumpy skin doesn't have much taste at all.");
      set_weight(1);
    break;

    case 1:
      set_short("a jackfruit");
      set_long("An oval, pale green, and bumpy fruit that looks very similar to "
	       "the breadfruit, but a little smaller. This one has no cracks "
	       "and is safe to eat.");
      set_id( ({ "jackfruit", "jack fruit", "fruit" }) );
开发者ID:ehershey,项目名称:pd,代码行数:25,代码来源:randomfood.c


示例14: create

void create() {
  ::create();
  set_heart_beat(1);
  set_short("");
  set_long("");
  set_weight(0);
  set_value(0);
  set_id(({"rage_ob_id"}));
开发者ID:ehershey,项目名称:pd,代码行数:8,代码来源:rage_ob_new.c


示例15: setup

void setup() {
   set_name( "skunk" );
   set_long( "A small black and white animal.\n" );
   set_height( 15 );
   set_weight( 30 );
   set_desc( "small brown meateater" );

   set_stats( ({ -2, 8, -2, -4, -4 }) );
开发者ID:Yuffster,项目名称:discworld_distribution_mudlib,代码行数:8,代码来源:skunk.c


示例16: setup

void setup() {
  set_name("bag");
  set_long("Its a bag, you can put things in it.\n");
  set_value(50);
  set_weight(10);
  set_max_weight(100);
  set_prevent_insert();
}
开发者ID:quixadhal,项目名称:discworld,代码行数:8,代码来源:bag.c


示例17: create

void create() {
 ::create();
   set_short("A strange herb");
   set_name("herb");
   set_long((: check_skills :));
   set_weight(2);
   set_value(0);
   set_id(({ "forage_herb_ob", "herb", "plant" }));
开发者ID:ehershey,项目名称:pd,代码行数:8,代码来源:herb.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ set_xen_guest_handle函数代码示例发布时间:2022-05-30
下一篇:
C++ set_viewport函数代码示例发布时间: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