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


C++ RemoveObject函数代码示例

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


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

示例1: FxPointingTimer

func FxPointingTimer(object target, int index, int time) {
	if(time > PT0D_Duration) {
		RemoveObject(target);
		return -1;
	}

	var clonk = GetCursor(EffectVar(0, target, index));
	var obj = EffectVar(1, target, index);
	var msg = EffectVar(2, target, index);

	// Zeiger hat kein Ziel mehr? Löschen.
	if(!obj) {
		RemoveObject(target);
		return -1;
	}

	var ang = Angle(GetX(clonk), GetY(clonk), GetX(obj), GetY(obj)) - 90;
	var dst = Min(PT0D_Distance, Distance(GetX(clonk), GetY(clonk), GetX(obj), GetY(obj)) / 2);

	SetR(ang + 90, target);
	SetPosition(GetX(clonk) + Cos(ang, dst), GetY(clonk) + Sin(ang, dst), target);

	var r, g, b, a;
	SplitRGBaValue(GetClrModulation(target), r, g, b, a);

	a = EvalEase(alphaEase, Min(254, time));
	SetClrModulation(RGBa(r, g, b, a), target);
	Message("<c %x>%s</c>", target, RGBa(r, g, b, 255 - a), msg);

	return true;
}
开发者ID:lluchs,项目名称:Clinfinity,代码行数:31,代码来源:Script.c

示例2: nbcb_ripup

static void
nbcb_ripup (Widget w, Std_Nbcb_Func v, XmPushButtonCallbackStruct * cbs)
{
  nbcb_std_callback (w, nbcb_find, cbs);

  VISIBLELINE_LOOP (PCB->Data);
  {
    if (TEST_FLAG (FOUNDFLAG, line) && !TEST_FLAG (LOCKFLAG, line))
      RemoveObject (LINE_TYPE, layer, line, line);
  }
  ENDALL_LOOP;

  VISIBLEARC_LOOP (PCB->Data);
  {
    if (TEST_FLAG (FOUNDFLAG, arc) && !TEST_FLAG (LOCKFLAG, arc))
      RemoveObject (ARC_TYPE, layer, arc, arc);
  }
  ENDALL_LOOP;

  if (PCB->ViaOn)
    VIA_LOOP (PCB->Data);
  {
    if (TEST_FLAG (FOUNDFLAG, via) && !TEST_FLAG (LOCKFLAG, via))
      RemoveObject (VIA_TYPE, via, via, via);
  }
  END_LOOP;
}
开发者ID:bert,项目名称:pcb-rnd,代码行数:27,代码来源:netlist.c

示例3: netlist_rip_up_cb

static void
netlist_rip_up_cb (GtkWidget * widget, gpointer data)
{

  if (!selected_net)
    return;
  netlist_find_cb(widget, data);

  VISIBLELINE_LOOP (PCB->Data);
  {
    if (TEST_FLAG (FOUNDFLAG, line) && !TEST_FLAG (LOCKFLAG, line))
      RemoveObject (LINE_TYPE, layer, line, line);
  }
  ENDALL_LOOP;

  VISIBLEARC_LOOP (PCB->Data);
  {
    if (TEST_FLAG (FOUNDFLAG, arc) && !TEST_FLAG (LOCKFLAG, arc))
      RemoveObject (ARC_TYPE, layer, arc, arc);
  }
  ENDALL_LOOP;

  if (PCB->ViaOn)
    VIA_LOOP (PCB->Data);
  {
    if (TEST_FLAG (FOUNDFLAG, via) && !TEST_FLAG (LOCKFLAG, via))
      RemoveObject (VIA_TYPE, via, via, via);
  }
  END_LOOP;

}
开发者ID:BenBergman,项目名称:geda-pcb,代码行数:31,代码来源:gui-netlist-window.c

示例4: Explode

// documented in /docs/sdk/script/fn
global func Explode(int level, bool silent, int damage_level)
{
	if(!this) FatalError("Function Explode must be called from object context");
	
	// Special: Implode
	if (level <= 0) return RemoveObject();

	// Shake the viewport.
	ShakeViewport(level);
	
	// Explosion parameters.
	var x = GetX(), y = GetY();
	var cause_plr = GetController();
	var container = Contained();
	var exploding_id = GetID();
	var layer = GetObjectLayer();

	// Explosion parameters saved: Remove object now, since it should not be involved in the explosion.
	RemoveObject();

	// Execute the explosion in global context.
	// There is no possibility to interact with the global context, apart from GameCall.
	// So at least remove the object context.
	exploding_id->DoExplosion(x, y, level, container, cause_plr, layer, silent, damage_level);
}
开发者ID:gitMarky,项目名称:openclonk,代码行数:26,代码来源:Explode.c

示例5: Activate

public func Activate(caster, real_caster)
{
  var clonk = caster;
  if (real_caster) clonk = real_caster;
  
  Sound("Magic1");

  var iChkEff;
  if (iChkEff = CheckEffect("FirefistNSpell", 0, 130)) return(iChkEff!=-1 && RemoveObject());

  var obj, nocrcnt;
  if (InLiquid(clonk) && (obj = FindContents(METL, clonk)))
    {
    var torpedo;
    SetDir(DIR_Left(),  torpedo=CreateObject(TRP1,-15,+10,-1));
    if (torpedo)
      {
      torpedo->Launch(torpedo); // Kleiner Trick damit das Torpedo in die richtige Richtung schwimmt
      torpedo->SetController(GetOwner(clonk)); // Damit eventuelle Tötungen auch gezählt werden
      }
    else ++nocrcnt;
    SetDir(DIR_Right(), torpedo=CreateObject(TRP1,+15,+10,-1));
    if (torpedo)
      {
      torpedo->Launch(torpedo); 
      torpedo->SetController(GetOwner(clonk));
      }
    else ++nocrcnt;
    if (nocrcnt < 2) RemoveObject(obj);
    }
  else
    {
    var firefist=CreateObject(FSHW,-15,0,GetOwner(clonk));
    if (firefist)
      {
      firefist->SetController(GetOwner(clonk));
      ObjectSetAction(firefist,"Left");
      }
    else ++nocrcnt;
    
    firefist=CreateObject(FSHW,+15,0,GetOwner(clonk));
    if (firefist)
      {
      firefist->SetController(GetOwner(clonk));
      ObjectSetAction(firefist,"Right");
      }
    else ++nocrcnt;
  }
  
  RemoveObject();
  return(nocrcnt < 2);
}
开发者ID:ckanibal,项目名称:clonk-content,代码行数:52,代码来源:Script.c

示例6: FxPullTimer

func FxPullTimer(object target, proplist fx, int time)
{
	if(!shooter)
		return RemoveObject();

	var dist = Distance(fx.x, fx.y, shooter->GetX(), shooter->GetY()); 
	
	if(dist < 5)
	{
		fx.cnt++;
	}
	var cd1 = Distance(GetX(), GetY(), fx.ox, fx.oy); 
	var cd2 = Distance(shooter->GetX(), shooter->GetY(), fx.ox, fx.oy); 
	
	if(cd1-cd2 < Size || (dist < 5 && fx.cnt == 2))
	{
		if(shooter->GetAction() == "Tumble")
			shooter->SetAction("Jump");
		
		if(shooter->GBackSolid(0, -12))
		{
			shooter->SetXDir(0);
			shooter->SetYDir(0);
			shooter->SetAction("Hangle");
		}
		
		if(shooter->GBackSolid(-9, 0) || shooter->GBackSolid(9, 0))
		{
			shooter->SetXDir(0);
			shooter->SetYDir(0);
			shooter->SetAction("Scale");
		}
	
		shooter->SetXDir(shooter->GetXDir(1000)/27, 100);
		shooter->SetYDir(shooter->GetYDir(1000)/27, 100);
				
		return RemoveObject();
	}
	
	if(time > LifeTime*2)
		return RemoveObject();
		
	//fx.angle = Angle(shooter->GetX(), shooter->GetY(), GetX(), GetY(), 10);
	shooter->SetAction("Jump");
	shooter->SetVelocity(fx.angle, Speed + 20, 10);
	
	fx.x = shooter->GetX();
	fx.y = shooter->GetY();
		
}
开发者ID:MDT-Maikel,项目名称:Knueppeln-Mod,代码行数:50,代码来源:Script.c

示例7: FxComebackTimer

func FxComebackTimer(object target, proplist effect, int time)
{
	if(!this)
		return;
	
	if(!shooter)
		return RemoveObject();

	if(ObjectDistance(this, shooter) < Size)
		return RemoveObject();

	var angle = Angle(GetX(), GetY(), shooter->GetX(), shooter->GetY(), 10);
	
	SetVelocity(angle, Speed + 40, 10);
}
开发者ID:MDT-Maikel,项目名称:Knueppeln-Mod,代码行数:15,代码来源:Script.c

示例8: Initialize

protected func Initialize()
{	
	// Under no circumstance there may by multiple copies of this rule.
	if (ObjectCount(Find_ID(Rule_Gravestones)) > 1)
		return RemoveObject();
	return;
}
开发者ID:TheBlackJokerDevil,项目名称:openclonk,代码行数:7,代码来源:Script.c

示例9: GotNugget

func GotNugget()
{
	--num_to_collect;
	if (num_to_collect == 0) GameCall("Finished");
	Sound("Cash");
	RemoveObject();
}
开发者ID:772,项目名称:openclonk,代码行数:7,代码来源:Script.c

示例10: Initialize

func Initialize() 
{
	CreateObject(TIME);
	aBann = CreateArray(5);
	aMoney = CreateArray(GetPlayerCount(0));
	if(FindObject(HELP)) RemoveObject(0);
	pHelper = CreateObject(HEL2);
	aSuperUser = CreateArray(1);
	aSuperUser[0] = "Nompl";
	aSuperUser[1] = "Gurkenglas™";
	aBann[0] = "MegaHazard";
	aBann[1] = "Tobiris";
	aBann[2] = "Cody";
	aBann[3] = "Chocobo";
	aBann[4] = "Gwisdo";
	aBann[5] = "Gwizdo";
	ScriptOn = 0;
//	AddMsgBoardCmd("DeactivateAll","Deactivate",true);
  	AddMsgBoardCmd("Msg","Msg(%s)",true);
//  	AddMsgBoardCmd("Money","Mony(%s)",true);  	
//  	AddMsgBoardCmd("Black-White","BlackWhite(%s)",true);  	
//  	AddMsgBoardCmd("Color","ReColor(%s)",true);  	
//  	AddMsgBoardCmd("Cheat","Cheat(%s)",true);
//		AddMsgBoardCmd("PriorHack","%s",true);
//  	AddMsgBoardCmd("Invisible","Invisib(%s)",true);
//		AddMsgBoardCmd("Power","PowerUp(%s)",true);
//  	AddMsgBoardCmd("SuperUser","AddSuperUser(%s)",true);
//  	AddMsgBoardCmd("Settings","FindObject(HELP) -> ChooseRules(%s)",true);
//  	AddMsgBoardCmd("Heal","Heal(%s)",true);
  	return(1);
}
开发者ID:maxmitti,项目名称:SGGP,代码行数:31,代码来源:Script.c

示例11: RemoveObject

void CSpatialTree::RemoveObject( CSpatialTreeObject * pSpatialTreeObject, bool deleteObj ) {

    RemoveObject( pSpatialTreeObject->GetEntityID(), deleteObj );
    
    /* defunct
    std::unordered_map< int, CSpatialTreeObject * >::iterator end = m_pQTObjects.end();
    std::unordered_map< int, CSpatialTreeObject * >::iterator target = m_pQTObjects.find( pSpatialTreeObject->GetEntityID() );
    
    if( target != end ) {
        
        if( m_pChildNodes ) {
            
            for( int j = 0; j < m_NumNodes; j++ ) {
             
                m_pChildNodes[j].RemoveObject( pSpatialTreeObject, deleteObj );
                
            }
            
        }
    
        m_pQTObjects.erase( target );
        
        if( !m_pParentNode && deleteObj ) {
            
            delete pSpatialTreeObject;
            
        }


    }
    */

    
}
开发者ID:RickDork,项目名称:Sora,代码行数:34,代码来源:SpatialTree.cpp

示例12: Initialize

func Initialize()
{
  var iTimeout,pWipf;
  SetGamma(RGB(15,15,15),RGB(118,118,118),RGB(215,215,215));
  SetSkyParallax(0,15,17,0,0,0,0); 
  //Handgemacht... ;)
  Meeresrauschen(170);
  Meeresrauschen(1100);
  Meeresrauschen(2060);
  Meeresrauschen(2900);
  Meeresrauschen(3800);
  Meeresrauschen(4800);
  Meeresrauschen(5700);
  Moewen(900);
  Moewen(2300);
  Moewen(3900);
  Moewen(5000);
  //Nebel platzieren
  for(var i;i<260;++i) 
    CreateParticle("Fog",Random(LandscapeWidth()),Random(LandscapeHeight()*2/3),RandomX(3,9),0,RandomX(1000,1500));
  //Wipfe platzieren
  while(pWipf=FindObject(WIPF,0,0,0,0,0,0,0,0,pWipf)) {
    iTimeout=0;
    while(Stuck(pWipf)||GetMaterial(GetX(pWipf),GetY(pWipf))!=Material("Tunnel")) {
      SetPosition(Random(LandscapeWidth()),RandomX(LandscapeHeight()*2/3,LandscapeHeight()),pWipf);
      if(iTimeout++ > 50000) { RemoveObject(pWipf); break; }
    }
  }  
  ScriptGo(1);
}
开发者ID:ckanibal,项目名称:clonk-content,代码行数:30,代码来源:Script.c

示例13: atan2f

void CEnemy2::Exec()
{
	if(shoot == false && y > 100){
		float angle = atan2f(player->GetPosY() - y, player->GetPosX() - x);
		AppendObject(
			new CEnemyBullet(x, y, angle, 2.0f),
			ENEMYBULLET_PRIORITY, true);
		shoot = true;
	}

	y += 2.0f;

	if(y > 480.0f + 16.0f || x < -16.0f || x > 640.0f + 16.0f)
	{
		RemoveObject(this);
		return;
	}

	sprite.Draw(x, y);

	if(this->HitTest(player)){
		player->Destroy();
		this->Damaged();
	}
}
开发者ID:Yuusuke525,项目名称:SandBox1st,代码行数:25,代码来源:Enemy.cpp

示例14: while

/*****************************************************************************\
	Draw all the objects in the display list which lie beyond the given ring
	Returns TRUE if any objects were actually drawn, FALSE otherwise.
\*****************************************************************************/
void ObjectDisplayList::DrawBeyond(float ringDistance, int LOD, class RenderOTW *renderer)
{
	//START_PROFILE("-->DRAW LIST");
	while(nextToDraw && (nextToDraw->distance >= ringDistance))
	{
		//COUNT_PROFILE("DRAW OBJECTS");
		// setup the object remove as false
		KillTheObject=RemoveTheObject=false;
		// do the object
		nextToDraw->Draw(renderer,LOD);
		// List self management... if an object requests to be killed
		if(RemoveTheObject){
			// keep the new item to draw
			DrawableObject *LastDrawn=nextToDraw->next;
			// remove the actual from list
			RemoveObject(nextToDraw);
			// if requests a deallocation, do it
			if(KillTheObject) delete nextToDraw;
			// get the pointer back
			nextToDraw=LastDrawn;
		} 
		else {
			nextToDraw = nextToDraw->next;
		}
	}
	//STOP_PROFILE("-->DRAW LIST");
}
开发者ID:FreeFalcon,项目名称:freefalcon-central,代码行数:31,代码来源:objlist.cpp

示例15: RemoveObject

void
LayerActivityTracker::NotifyExpired(LayerActivity* aObject)
{
  RemoveObject(aObject);

  nsIFrame* f = aObject->mFrame;
  nsIContent* c = aObject->mContent;
  aObject->mFrame = nullptr;
  aObject->mContent = nullptr;

  MOZ_ASSERT((f == nullptr) != (c == nullptr),
             "A LayerActivity object should always have a reference to either its frame or its content");

  if (f) {
    // The pres context might have been detached during the delay -
    // that's fine, just skip the paint.
    if (f->PresContext()->GetContainerWeak()) {
      f->SchedulePaint();
    }
    f->RemoveStateBits(NS_FRAME_HAS_LAYER_ACTIVITY_PROPERTY);
    f->Properties().Delete(LayerActivityProperty());
  } else {
    c->DeleteProperty(nsGkAtoms::LayerActivity);
  }
}
开发者ID:cbrem,项目名称:gecko-dev,代码行数:25,代码来源:ActiveLayerTracker.cpp


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