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

C++ set_target函数代码示例

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

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



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

示例1: on_move

void on_move( object src ) {
   ::on_move( src );
   if( !src ) return;
   if( !solid && !environment()->query_container() ) {
      object old_targ;

      old_targ = query_target();
      set_target(this_object());
      if( this_player() )
         this_player()->msg_local( "~CACT~Subt ~vertdissipate as ~name ~verbpour it out.~CDEF" );
      set_target( old_targ );
      destruct( this_object() );
   }
}
开发者ID:shentino,项目名称:simud,代码行数:14,代码来源:liquid.c


示例2: on_cast

varargs int on_cast(mapping param) {
    object jack, ai;
    int bonus = param["caster"]->skill_check("magic.mana.fire",50,60,70,80,90,100);

    set_actor(param["caster"]);
    set_target(param["target"]);
    param["caster"]->msg_local("~[030~Subt ~verttake on a life of ~post own and ~vertbegin to float next to ~name.~CDEF");
    destruct(param["target"]);

    jack = clone_object("/monsters/summon/jackolantern");
    jack->move(environment(param["caster"]));
    jack->validate_position();
    // heal pumpkin man
    jack->set_stat("con",jack->query_stat("con")+(bonus/2));
    jack->set_stat("int",jack->query_stat("int")+(bonus/2));
    jack->set_stat("spd",jack->query_stat("spd")+bonus);
    jack->set_stat("wil",jack->query_stat("wil")+bonus);

    jack->set_hp(jack->query_max_hp());
    jack->set_mana(jack->query_max_mana());
    jack->set_endurance(jack->query_max_endurance());

    // unfortunately, on_hire is a bit flaky right now and only works if the caster is
    // set to this_player()
    ai = present_clone("/ai/worker",jack);
    ai->on_hire();

    command("follow "+(param["caster"]->query_name()),jack);

    jack->set_time_to_live( max(20,param["caster"]->get_skill_roll("magic.faith.blessing")/2) );

    return 1;
}
开发者ID:shentino,项目名称:simud,代码行数:33,代码来源:animate_pumpkin.c


示例3: main

main(string param) {
   object ob, *obs, i, n, env;
   string s;

   ADM_CHECK

   if(!param) {
      msg("==> [Format] nuke <objects>");
      return 1;
   }

   ob = find_thing(param);

   if(!ob) {
      notify_fail("==> [Error] Unable to locate object "+param+"\n");
      return 0;
   }

   obs = all_inventory( ob );

   set_target(ob);
   this_player()->msg_local("~CBRT~Name ~verbclap ~poss hands. A heavy banging sound is heard, like a cannon-shot.~CDEF");

   foreach( ob : obs ) {
      if( !ob->query_is_player() )
         destruct(ob);
   }
   return 1;
}
开发者ID:shentino,项目名称:simud,代码行数:29,代码来源:nuke.c


示例4: set_target

void Camera::init_camera (Actor *target)
{
    m_frame.x = 0;
    m_frame.y = 0;
    if (target)
    {
        set_target (target);
    }
    m_frame.w = Constants::WINDOW_WIDTH;
    m_frame.h = Constants::WINDOW_HEIGHT;
    PRINT_TRACE (1, "Ouverture de la fenetre (de taille %d*%d)", m_frame.w, m_frame.h)
    if (!m_initialized)
    {
        if (Constants::FULL_SCREEN == 0)
        {
            m_window = new sf::RenderWindow (sf::VideoMode (m_frame.w, m_frame.h, 32), "SuperBadbar");
        }
        else
        {
            m_window = new sf::RenderWindow (sf::VideoMode (m_frame.w, m_frame.h, 32), "SuperBadbar", sf::Style::Fullscreen);
        }
        EventKeyboard::initEventKeyboard();
    }
    m_target = target;
#ifdef DEBUG_COLL
    m_green_coll = new Surface (PIC_DEBUG_R + "green_col.png");
    m_red_coll = new Surface (PIC_DEBUG_R + "red_col.png");
#endif
    m_initialized = true;
}
开发者ID:joetde,项目名称:SuperBadbar,代码行数:30,代码来源:Camera.cpp


示例5: get_target_range_radial

void
AATPoint::set_target(const fixed range, const fixed radial,
                     const TaskProjection &proj)
{
  fixed oldrange = fixed_zero;
  fixed oldradial = fixed_zero;
  get_target_range_radial(oldrange, oldradial);

  const FlatPoint fprev = proj.fproject(get_previous()->get_location_remaining());
  const FlatPoint floc = proj.fproject(get_location());
  const FlatLine flb (fprev,floc);
  const FlatLine fradius (floc,proj.fproject(get_location_min()));
  const fixed bearing = fixed_minus_one * flb.angle().value_degrees();
  const fixed radius = fradius.d();

  fixed swapquadrants = fixed_zero;
  if (positive(range) != positive(oldrange))
    swapquadrants = fixed(180);
  const FlatPoint ftarget1 (fabs(range) * radius *
        cos((bearing + radial + swapquadrants)
            / fixed(360) * fixed_two_pi),
      fabs(range) * radius *
        sin( fixed_minus_one * (bearing + radial + swapquadrants)
            / fixed(360) * fixed_two_pi));

  const FlatPoint ftarget2 = floc + ftarget1;
  const GeoPoint targetG = proj.funproject(ftarget2);

  set_target(targetG, true);
}
开发者ID:Mrdini,项目名称:XCSoar,代码行数:30,代码来源:AATPoint.cpp


示例6: on_use

int on_use( object target ) {
   object bldg;
   object ilock, idoor;

   if( target ) return 0;

   bldg = query_condemn_obj();

   if( !bldg ) {
      msg( "The building has disappeared! This condemnation isn't valid anymore." );
      destruct(this_object());
      return 1;
   }

   if( condemn_time > time() ) {
      msg( "The warning time hasn't expired yet. You can't enforce the condemnation." );
      return 1;
   }

   foreach( ilock : deep_inventory(bldg) ) {
      if( ilock->query_is_lock() ) destruct(ilock);
   }
   foreach( idoor: all_inventory(environment(bldg)) ) {
      if( idoor->query_host() == bldg )
      foreach( ilock: all_inventory(idoor) )
         if( ilock->query_is_lock() ) destruct(ilock);
   }
   set_target(bldg);
   this_player()->msg_local( "~CACT~Name ~verbenforce the condemnation on ~targ by uprooting the sign and whacking the building with it. Ka-boom!~CDEF" );
   msg( "All locks have been removed from the building, and anyone can raze it now." );
   bldg->set_owner( 0 );
   destruct( this_object() );
   return 1;
}
开发者ID:shentino,项目名称:simud,代码行数:34,代码来源:condemn_sign.c


示例7: exportData

 void ProtoBufExport::Include(clang::FileEntry const *origin, clang::FileEntry const *target) {
     exportData([&](ct::proto::Envelope &env) {
         auto incl = env.mutable_include();
         incl->set_origin(origin->getName());
         incl->set_target(target->getName());
     });
 }
开发者ID:search-rug,项目名称:cpptool,代码行数:7,代码来源:protobuf_export.cpp


示例8: on_cast

varargs int on_cast(mapping param) {
	object decoy;
	int hp;

	// debit hp first
	hp = to_int(param["caster"]->query_hp() * 0.95);
	param["caster"]->add_hp( -hp );

	// check for existing decoys... backlash
	decoy = present_clone( "/monsters/summon/decoy", environment(param["caster"]) );
	if( decoy ) {
		param["caster"]->msg_local( "~[030~Name ~verbstand completely still until ~pron ~verbis knocked down by a green blast.~CDEF" );
		msg_object( param["caster"], "~CWRNThere is already a decoy spirit at this location. Your spell has backfired.~CDEF" );
		param["caster"]->set_stance( ST_LYING );
		return 1;
	}

	// actually create the pet now
	decoy = clone_object( "/monsters/summon/decoy" );
	decoy->move(environment(param["caster"]));
    decoy->set_coord(WALK_DAEMON->query_random_adjacent(param["caster"]));
	decoy->validate_position();
	decoy->setup( param["caster"]->query_name(), hp );

	set_actor(param["caster"]);
	set_target(decoy);
	param["caster"]->msg_local( "~[030~Name ~verbstand completely still as ~targ ~vertfade into view beside ~obje.~CDEF" );

	return 1;
}
开发者ID:shentino,项目名称:simud,代码行数:30,代码来源:decoy.c


示例9: m_target

Messenger::Messenger(Handler* target_, Looper* looper_, status_t* result)
:	m_target(NULL),
	m_looper(NULL)
{
	status_t sts = set_target(target_, looper_);
	if(result) *result = sts;
}
开发者ID:snori,项目名称:ntk,代码行数:7,代码来源:messenger.cpp


示例10: parse_probe_event_argv

static int parse_probe_event_argv(int argc, const char **argv)
{
	int i, len, ret, found_target;
	char *buf;

	found_target = set_target(argv[0]);
	if (found_target < 0)
		return found_target;

	if (found_target && argc == 1)
		return 0;

	/* Bind up rest arguments */
	len = 0;
	for (i = 0; i < argc; i++) {
		if (i == 0 && found_target)
			continue;

		len += strlen(argv[i]) + 1;
	}
	buf = zalloc(len + 1);
	if (buf == NULL)
		return -ENOMEM;
	len = 0;
	for (i = 0; i < argc; i++) {
		if (i == 0 && found_target)
			continue;

		len += sprintf(&buf[len], "%s ", argv[i]);
	}
	params.mod_events = true;
	ret = parse_probe_event(buf);
	free(buf);
	return ret;
}
开发者ID:spacex,项目名称:kernel-centos7,代码行数:35,代码来源:builtin-probe.c


示例11: main

int main(string arg) {
  object who, victim;
		
  WIZ_CHECK

  if( !arg )
    return notify_fail("==> [Format] frotz victim\n");

  victim = find_player(arg);
  if( !victim )
    return notify_fail("I can't find any such player '"+arg+"' to zap.\n");

  AUDIO_DAEMON->sfx_mud("thunder.wav");

  foreach( who : users() ) {
    set_actor( this_player() );
    set_target( victim );
    set_listener( who );
    msg_object(who,"~CTITFROTZ! ~CBRT~Name ~verbstrike ~targ with lightning.~CDEF");
  }

  victim->set_env_var( "cause_of_death", "was frotzed by "+capitalize(this_player()->query_name())+"." );
  victim->add_hp( this_player()->query_level() / -4);

  return 1;
}
开发者ID:shentino,项目名称:simud,代码行数:26,代码来源:frotz.c


示例12: remove_armour

varargs int remove_armour(int silent) {
   object owner = environment(this_object()), obj;
   if (!worn)
      return 0;
   if (!owner->query_is_living())
      return 0;
   set_target(this_object());
   // check if they're wearing anything over this item
   foreach ( obj : all_inventory(owner) ) {
      if( obj->query_is_apparel() &&
         (obj->query_body_parts() & query_body_parts()) &&
         obj->query_layer() > layer) {
         if( !silent )
           msg("You can't remove ~targ, without first removing "+obj->query_name()+".");
         return 0;
      }
   }
   // returns true if on_remove() has been defined, so false means we have
   // to do this our selves as well
   if (this_object()->on_remove() == 0) {
      if (this_object()->query_cursed()) {
         if (!silent)
            msg_object(owner,"You can't remove ~targ! It appears to be cursed!");
      } else {
         if (!silent)
            owner->msg_local("~Name ~verbremove ~targ.");
         set_worn(0);
         owner->recalc();
         return 1;
      }
   }
}
开发者ID:shentino,项目名称:simud,代码行数:32,代码来源:apparel.c


示例13: bcf_srs

 bcf_srs(bcf_srs_helper::init &init) : bcf_srs() {
   if (!init.region.empty()) {
     if (init.useIndex)
       set_region(init.region);
     else
       set_target(init.region);
   }
 }
开发者ID:wkretzsch,项目名称:htslibpp,代码行数:8,代码来源:synced_bcf_reader.hpp


示例14: kms_base_hub_link_src_pad

static gboolean
kms_base_hub_link_src_pad (KmsBaseHub * mixer, const gchar * gp_name,
    const gchar * template_name, GstElement * internal_element,
    const gchar * pad_name, gboolean remove_on_unlink)
{
  GstPad *gp, *target;
  gboolean ret;

  if (GST_OBJECT_PARENT (internal_element) != GST_OBJECT (mixer)) {
    GST_ERROR_OBJECT (mixer, "Cannot link %" GST_PTR_FORMAT " wrong hierarchy",
        internal_element);
    return FALSE;
  }

  target = gst_element_get_static_pad (internal_element, pad_name);
  if (target == NULL) {
    target = gst_element_get_request_pad (internal_element, pad_name);

    if (target != NULL && remove_on_unlink) {
      g_signal_connect (G_OBJECT (target), "unlinked",
          G_CALLBACK (remove_unlinked_pad), NULL);
    }
  }

  if (target == NULL) {
    GST_ERROR_OBJECT (mixer, "Cannot get target pad");
    return FALSE;
  }

  gp = gst_element_get_static_pad (GST_ELEMENT (mixer), gp_name);

  if (gp == NULL) {
    GstPadTemplate *templ;

    templ =
        gst_element_class_get_pad_template (GST_ELEMENT_CLASS
        (G_OBJECT_GET_CLASS (mixer)), template_name);
    gp = gst_ghost_pad_new_from_template (gp_name, target, templ);

    if (GST_STATE (mixer) >= GST_STATE_PAUSED
        || GST_STATE_PENDING (mixer) >= GST_STATE_PAUSED
        || GST_STATE_TARGET (mixer) >= GST_STATE_PAUSED) {
      gst_pad_set_active (gp, TRUE);
    }

    ret = gst_element_add_pad (GST_ELEMENT (mixer), gp);
    if (!ret) {
      g_object_unref (gp);
    }
  } else {
    ret = set_target (gp, target);
    g_object_unref (gp);
  }

  g_object_unref (target);

  return ret;
}
开发者ID:oldcookie,项目名称:gst-kurento-plugins,代码行数:58,代码来源:kmsbasehub.c


示例15: main

int main(string str) {
  string what, as_str;
  int quality, fail;
  object ob, as;

  if( !str ) {
      notify_fail("What do you want to sign?\n");
      return 0;
  }
  /* forging commented out for now
  if (sscanf( str, "%s as %s", what, as_str ) < 2) {
    what = str;
    as = this_player();
  } else {
    as = find_player(as_str);
    if (!as)
      as = present(as_str,environment(this_player()));
    if (!as || !as->query_is_living()) {
      notify_fail("I don't know who you mean by '"+str+"'.");
      return 0;
    }
  }
  */
  what=str;
  as=this_player();

  ob = single_present( what, this_player() );
  if( !ob ) ob = single_present( str, environment(this_player()) );
  if( !ob ) {
    notify_fail("I don't know what you mean by "+str+"\n");
    return 0;
  }

  // quality is indication of how much it looks right
  // won't look right if you're tired
  if (as == this_player()) {
    quality = 100;
    if (this_player()->query_endurance() < this_player()->query_max_endurance())
      quality = quality - this_player()->query_max_endurance() + this_player()->query_endurance();
  } else {
    quality = 1;
  }

  if( (fail = ob->on_sign(as->query_name(), quality)) > 0) {
    set_target(ob);
    this_player()->msg_local("~CACT~Name ~verbsign ~targ.~CDEF");
    this_player()->set_doing("signing ~targ", this_object());

    return 1;
  } else {
    switch(fail) {
    case HAS_SIGNED: notify_fail("You've already signed it.\n"); break;
    case CANT_EDIT: //fall through
    default: notify_fail("You can't sign that.\n"); break;
    }
    return 0;
  }
}
开发者ID:shentino,项目名称:simud,代码行数:58,代码来源:sign.c


示例16: UpdateData

void CFeatureFmt_dlg::reset_custom(Format_style style)
{
    m_custom_ctl.SetWindowText("");
    UpdateData(TRUE);
    Feature_fmt tmp_tgt;
    set_target(tmp_tgt);
    tmp_tgt.set(data,style);
    m_custom_ctl.SetWindowText(Feature::format);
}
开发者ID:giuliomarin,项目名称:winprom,代码行数:9,代码来源:FeatureFmt_dlg.cpp


示例17: on_cast

varargs int on_cast(mapping param) {
	object apple = single_present(param["component"], param["caster"]);
	set_actor(param["caster"]);
	set_target(apple);
	param["caster"]->msg_local("~[030The turtle chomps ~targ, gulping it down before turning to carry ~npos message to its destination... eventually...~CDEF");
	enqueue_delivery( param["option"], param["target"]->query_location("front") );
	destruct(apple);
	return 1;
}
开发者ID:shentino,项目名称:simud,代码行数:9,代码来源:animal_messenger.c


示例18: TimedEvent

/*** TimedCallback ***/
TimedCallback::TimedCallback(CallBack *t, void *d, uint32 wait_time, bool repeat)
    : TimedEvent(wait_time, TIMER_DELAYED, TIMER_REALTIME)
{
    set_target(t);
    set_user_data(d);
    repeat_count = repeat ? -1 : 0;

    queue(); // start
}
开发者ID:nuvie,项目名称:nuvie,代码行数:10,代码来源:TimedEvent.cpp


示例19: create_link_label

        std::unique_ptr<link_label_type> create_link_label()
        {
            auto p_label =tetengo2::stdalt::make_unique<link_label_type>(m_base);

            p_label->set_text(string_type{ TETENGO2_TEXT("http://www.tetengo.org/") });
            p_label->set_target(p_label->text());

            return std::move(p_label);
        }
开发者ID:xiaomailong,项目名称:bobura,代码行数:9,代码来源:bobura.about_dialog.cpp


示例20: set_up

void Camera::init(glm::vec3 position,
				  glm::vec3 target, 
				  glm::vec3 up,
				  float speed)
{
	set_up(up);
	set_speed(speed);
	set_target(target);
	set_position(position);
	resetMouseToCenter();
	lookAt();
}
开发者ID:jaykumarark,项目名称:physikaX,代码行数:12,代码来源:Camera.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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