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

C++ FindObject函数代码示例

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

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



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

示例1: InitializePlayer

func InitializePlayer(int iPlayer)
{
	_inherited();
	var pClonk;
	if(GetPlayerTeam(iPlayer) == 1)
	{
		pClonk = CreateObject(JAFA,0,0,iPlayer);
		pClonk -> Enter(FindObject(GOEB,0,0,LandscapeWidth(),LandscapeHeight()/2));
		MakeCrewMember(pClonk,iPlayer);
		CreateContents(FLAG,pClonk);
		SetCursor(iPlayer,pClonk);
		pClonk = CreateObject(JAFA,0,0,iPlayer);
		pClonk -> Enter(FindObject(GOEB,0,0,LandscapeWidth(),LandscapeHeight()/2));
		MakeCrewMember(pClonk,iPlayer);
	}
	if(GetPlayerTeam(iPlayer) == 2)
	{
		pClonk = CreateObject(WRAT,0,0,iPlayer);
		pClonk -> Enter(FindObject(GOEB,0,LandscapeHeight()/2,LandscapeWidth(),LandscapeHeight()/2));
		MakeCrewMember(pClonk,iPlayer);
		CreateContents(FLAG,pClonk);
		SetCursor(iPlayer,pClonk);
		pClonk = CreateObject(WRAT,0,0,iPlayer);
		pClonk -> Enter(FindObject(GOEB,0,LandscapeHeight()/2,LandscapeWidth(),LandscapeHeight()/2));
		MakeCrewMember(pClonk,iPlayer);
	}
}
开发者ID:maxmitti,项目名称:SGGP,代码行数:27,代码来源:Script.c


示例2: DxFont

void TestScene::Init()
{
	font = new DxFont();
	this->AppendObject(font, 1, true);
	this->AppendItemBox("font", font);

	tex = new Texture("soccerball.png");
	sprite = new Sprite(tex);
	this->AppendItemBox("tex", tex);
	this->AppendItemBox("sprite", sprite);

	r=0.f;

	AppendObject(new BGMusic("Kalimba.mp3"), 5, "BGM", true);
	AppendItemBox("BGM", FindObject("BGM"));
	bgm = dynamic_cast<BGMusic*>(this->FindItemBox("BGM"));
	//if(bgm) bgm->Play();

    input = (Input*)FindObject("input");  
    if(input == NULL){  
        input = new Input();  
        AppendObject(input, 0, "input", true);  
    } 

	sound.Load("missile.wav");
	Sound *se = new Sound(*(Sound*)FindItemBox("burst"));
	//se->EnableDeleteByEnd();
	se->Play();
}
开发者ID:MKomiya,项目名称:Javelin,代码行数:29,代码来源:TestScene.cpp


示例3: Intro_Stop

func Intro_Stop()
{
	// Lava gets quiet after intro
	var lava = FindObject(Find_ID(BoilingLava));
	if (lava) lava->SetIntensity(25);
	// if players got stuck somewhere, unstick them
	for (var i=0; i<GetPlayerCount(C4PT_User); ++i)
	{
		var plr = GetPlayerByIndex(i, C4PT_User);
		var crew = GetCrew(plr);
		if (crew && !Inside(crew->GetX(),125,170))
		{
			crew->SetPosition(135+Random(25), 860);
		}
		crew->Extinguish();
		crew->DoEnergy(100);
	}
	this.dialogue->SetInteraction(true);
	this.dialogue->AddAttention();
	SetPlayerZoomByViewRange(NO_OWNER, 400,300, PLRZOOM_Set);
	
	// Turn and relocate the airplane to make starting it easier.
	var plane = FindObject(Find_ID(Airplane));
	if (plane)
	{
		plane->FaceLeft();
		plane->SetR(-90);
		plane->SetPosition(1387, 345);
	}
	return true;
}
开发者ID:aburgm,项目名称:openclonk,代码行数:31,代码来源:SeqIntro.c


示例4: FxBoomAttackTimer

global func FxBoomAttackTimer(object target, effect, int time)
{
	var wave = 1+time/35/Boomattack_wave_delay;

	if(time/35 % Boomattack_wave_delay == 1)
	{
		var gol = FindObject(Find_ID(Goal_SaveTheWindmills));
		if(gol)
			gol->SetWave(wave);
		if (wave < 13)
		{
			CustomMessage(Format("                   $MsgWave$                   ",wave),nil,NO_OWNER);
			var wave_strength = Sqrt(9+GetPlayerCount()*time/Boomattack_attack_growth);
			CreateAttackWave( Random(360) , wave_strength,Boomattack_angle_spread);
		}
		else if (wave == 13)
		{
			CustomMessage("                   $MsgBoss$                   ",nil,NO_OWNER);
			CreateAttackWave( Random(360) , -1, Boomattack_angle_spread);
			var gol = FindObject(Find_ID(Goal_SaveTheWindmills));
			if(gol) gol->BossAttacks();
		}

	}
}
开发者ID:772,项目名称:openclonk,代码行数:25,代码来源:Script.c


示例5: Script80

func Script80()
{
	var pHut = FindObject(HUT2);
  if(!FindObject(0,pHut->GetX()-80,pHut->GetY()-50,100,100,OCF_CrewMember)) { goto(80); return; }
  SetPlrShowControl(0,"____4_678_    4 678 ____4_____");
  TutorialMessage("$TxtStopexactlyinfrontof$");
  goto(110);
}
开发者ID:ckanibal,项目名称:clonk-content,代码行数:8,代码来源:Script.c


示例6: Initialize

protected func Initialize()
{
  // Anfangsgeldwert
  value=GetWealth(GetOwner());
  if(Local(CheckTeam(GetOwner()), FindObject(TACC))) value = Local(CheckTeam(GetOwner()), FindObject(TACC));
  else Local(CheckTeam(GetOwner()), FindObject(TACC)) = value;
  SetWealth(GetOwner(), value);
}
开发者ID:ckanibal,项目名称:clonk-content,代码行数:8,代码来源:Teamaccount.c


示例7: FindObject

  //
  // Simulation
  //
  Bool TrackCam::Simulate(FamilyNode *viewNode, F32 time)
  {
    Bool bindMod1 = Common::Input::GetModifierKey(1);
    Bool bindMod2 = Common::Input::GetModifierKey(2);

    if (trackObj.Alive())
    {
      // Check that we are allowed to track this object
      if (!CanTrack(trackObj))
      {
        trackObj = FindObject(trackObj, FO_NEXT);
      }
    }
    else
    {
      // If object is dead, go to next object
      trackObj = FindObject(trackObj, FO_NEXT);
    }

    if (trackObj.Alive())
    {
      switchDelay = DEFAULT_SWITCH_DELAY;

      if (rScroll)
      {
        if (bindMod1 && bindMod2)
        {
          SetRadius(targetRadius + (F32(dy) * time * swoopRate * 2.0F));
        }
        else

        if (!bindMod1 && !bindMod2)
        {
          if (dx)
          {
            // Circle about the object
            qView.Rotate(time * F32(-dx) * DEG2RAD * spinRate, Matrix::I.up);
          }
          if (dy)
          {
            SetPitch(pitch + (time * F32(-dy) * DEG2RAD * spinRate));
          }
        }
        else

        if (Input::GetKeyState() & Input::LBUTTONDOWN)
        {
          // Circle about the object
          SetRadius(targetRadius + (F32(dy) * time * swoopRate * 2.0F));

          // Set mouse to centre of screen
          Input::SetMousePos(Vid::backBmp.Width() >> 1, Vid::backBmp.Height() >> 1);
        }

        // Set mouse to centre of screen
        Input::SetMousePos(Vid::backBmp.Width() >> 1, Vid::backBmp.Height() >> 1);
      }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:60,代码来源:viewer_track.cpp


示例8: Script5

func Script5()
{
  SetPlrShowControl(0,"___345678_   345678 __________");  
  TutorialMessage("$TxtTheskyislandinthecen$");
  // Positionen speichern
  iBlnX = FindObject(BALN)->GetX(); iBlnY = FindObject(BALN)->GetY();
  iPlrX = FindObject(CLNK)->GetX(); iPlrY = FindObject(CLNK)->GetY();
  iCounter = 20;
}
开发者ID:ckanibal,项目名称:clonk-content,代码行数:9,代码来源:Script.c


示例9: ProfileX

void KVCanvas::ProfileX(TH2* hh)
{
   TObject* pfx = 0;
   if ((pfx = FindObject(Form("%s_pfx", hh->GetName())))) pfx->Delete();
   hh->ProfileX("_pfx", 1, -1, "i,d,same");
   if ((pfx = FindObject(Form("%s_pfx", hh->GetName()))))((TProfile*)pfx)->SetLineColor(kBlack);
   Modified();
   Update();
}
开发者ID:GiuseppePast,项目名称:kaliveda,代码行数:9,代码来源:KVCanvas.cpp


示例10: Script84

func Script84()
{
  if (FindObject(HUT3)->GetBase()) return(goto(84));
  Sound("Applause");
  TutorialMessage("$TxtExcellent$");
  FindObject(SCRG)->Fulfill();
  SetNextMission("Tutorial.c4f\\Tutorial03.c4s", "$BtnNextTutorial$", "$BtnNextTutorialDesc$");
  return(1);
}
开发者ID:ckanibal,项目名称:clonk-content,代码行数:9,代码来源:Script.c


示例11: Initialize

protected func Initialize()
{
	// Environment 
	CreateObject(Rule_ObjectFade)->DoFadeTime(10 * 36);
	
	GetRelaunchRule()->SetLastWeaponUse(false);
	
	var time=CreateObject(Time);
	time->SetTime();
	time->SetCycleSpeed();
	FindObject(Find_ID(Moon))->SetMoonPhase(3);
	FindObject(Find_ID(Moon))->SetCon(150);
	FindObject(Find_ID(Moon))->SetPosition(LandscapeWidth()/2,150);

	// Goal: Capture the flag, with bases in both hideouts.
	var goal = CreateObject(Goal_CaptureTheFlag, 0, 0, NO_OWNER);
	goal->SetFlagBase(1, 135, 266);
	goal->SetFlagBase(2, LandscapeWidth() - 135, 266);
	CreateObject(Rule_KillLogs);	
	
	var gate = CreateObjectAbove(StoneDoor, 345, 272, NO_OWNER);
	gate->SetClrModulation(RGB(140,185,255));
	gate->SetAutoControl(1);
	var gate = CreateObjectAbove(StoneDoor, LandscapeWidth()-344, 272, NO_OWNER);
	gate->SetClrModulation(RGB(140,185,255));
	gate->SetAutoControl(2);

	// Chests with weapons.
	var chest;
	chest = CreateObjectAbove(Chest, 60, 220, NO_OWNER);
	chest->MakeInvincible();
	AddEffect("FillBaseChest", chest, 100, 7 * 36,nil,nil,false);
	chest = CreateObjectAbove(Chest, 150, 370, NO_OWNER);
	chest->MakeInvincible();
	AddEffect("FillBaseChest", chest, 100, 7 * 36,nil,nil,true);
	chest = CreateObjectAbove(Chest, LandscapeWidth() - 60, 220, NO_OWNER);
	chest->MakeInvincible();
	AddEffect("FillBaseChest", chest, 100, 7 * 36,nil,nil,false);
	chest = CreateObjectAbove(Chest, LandscapeWidth() - 150, 370, NO_OWNER);
	chest->MakeInvincible();
	AddEffect("FillBaseChest", chest, 100, 7 * 36,nil,nil,true);

	
	chest = CreateObjectAbove(Chest, LandscapeWidth()/2, 320, NO_OWNER);
	chest->MakeInvincible();
	AddEffect("FillOtherChest", chest, 100, 5 * 36);
	
	AddEffect("SnowyWinter", nil, 100, 1);
	Sound("Environment::WindLoop",true,20,nil,+1);
	AddEffect("GeysirExplosion", nil, 100, 1);
	// Brick edges, notice the symmetric landscape.
	PlaceEdges();
	return;
}
开发者ID:Fulgen301,项目名称:openclonk,代码行数:54,代码来源:Script.c


示例12: Initialize

protected func Initialize()
{
  // Spielziele setzen
  FindObject(CROB)->AddType(CST3, 1);
  FindObject(CROB)->AddType(TWR2, 2);
  FindObject(CROB)->AddType(HUT3, 6);
  FindObject(CROB)->SetMissionAccess("NewLand");
  // Einzelne Hütte erzeugen
  CreateConstruction(HUT2, 1070, 330, -1, 100, 1);
  return 1;
}
开发者ID:ckanibal,项目名称:clonk-content,代码行数:11,代码来源:Script.c


示例13: RemoveAll

global func RemoveAll(id idDef, int dwOCF)
  {
  var Cnt, obj = FindObject(idDef, 0,0,0,0, dwOCF), next;
  while (obj)
    {
    // Get the next object in case obj->Destruction does funny things
    next = FindObject(idDef, 0,0,0,0, dwOCF, 0,0,0, obj);
    if(RemoveObject(obj))
      ++Cnt;
    obj = next;
    }
  return(Cnt);
  }
开发者ID:ckanibal,项目名称:clonk-content,代码行数:13,代码来源:Helpers.c


示例14: FindObject

static vlc_object_t * FindObject( vlc_object_t *p_this, int i_type, int i_mode )
{
    int i;
    vlc_object_t *p_tmp;

    switch( i_mode & 0x000f )
    {
    case FIND_PARENT:
        p_tmp = p_this->p_parent;
        if( p_tmp )
        {
            if( p_tmp->i_object_type == i_type )
            {
                p_tmp->i_refcount++;
                return p_tmp;
            }
            else
            {
                return FindObject( p_tmp, i_type, i_mode );
            }
        }
        break;

    case FIND_CHILD:
        for( i = p_this->i_children; i--; )
        {
            p_tmp = p_this->pp_children[i];
            if( p_tmp->i_object_type == i_type )
            {
                p_tmp->i_refcount++;
                return p_tmp;
            }
            else if( p_tmp->i_children )
            {
                p_tmp = FindObject( p_tmp, i_type, i_mode );
                if( p_tmp )
                {
                    return p_tmp;
                }
            }
        }
        break;

    case FIND_ANYWHERE:
        /* Handled in vlc_object_find */
        break;
    }

    return NULL;
}
开发者ID:forthyen,项目名称:SDesk,代码行数:50,代码来源:objects.c


示例15: ControlUseStart

func ControlUseStart(object clonk, int ix, int iy)
{
    // Auto-use on spin wheel
    var wheel = FindObject(Find_AtRect(-5,-5,10,10), Find_ID(SpinWheel));
    if (!wheel) wheel = FindObject(Find_AtPoint(ix,iy), Find_ID(SpinWheel));
    if (!wheel)
    {
        if (clonk->GetMenu()) clonk->CloseMenu();
        else Dialogue->MessageBox("$KeyNoLock$", clonk, clonk, nil, true);
    }
    else
        wheel->CheckLock(clonk); // using on wheel
    return true;
}
开发者ID:pkern,项目名称:openclonk,代码行数:14,代码来源:Script.c


示例16: InitializePlayer

func InitializePlayer(int iPlr)
{
	// Message positioning
	SetPlrShowControlPos(iPlr, SHOWCTRLPOS_TopLeft);
	SetTutorialMessagePos(MSG_Top | MSG_Left | MSG_WidthRel | MSG_XRel, 50, 50, 30);
	
  SetPlrShowControl(0,"___345678_   345678 __________");  
  
  // Positionen speichern
  iBlnX = FindObject(BALN)->GetX(); iBlnY = FindObject(BALN)->GetY();
  iPlrX = FindObject(CLNK)->GetX(); iPlrY = FindObject(CLNK)->GetY();
  iCounter = 0;
  
  CreateMaterial(iPlr);
}
开发者ID:ckanibal,项目名称:clonk-content,代码行数:15,代码来源:Script.c


示例17: OnSale

func OnSale(int to_player, object sale_base)
{
	// Inform goal of gem sale
	var goal = FindObject(Find_ID(Goal_SellGems));
	if (goal) goal->OnGemSold();
	return true;
}
开发者ID:sarah-russell12,项目名称:openclonk,代码行数:7,代码来源:Script.c


示例18: liquid

/**
Extract liquid from this
@param sznMaterial: Material to extract
@param inMaxAmount: Max Amount of Material being extracted 
@param pnPump: Object which extracts the liquid
@param pnPipe: Pipe which extracts the liquid (connected to pnPump)
@param bnWildcard: Usefull to extract random liquids; use '*' for sznMaterial for all Materials
@return [irMaterial,irAmount]
	-irMaterial: Material being extracted
	-irAmount: Amount being extracted
*/
public func LiquidOutput(string sznMaterial, int inMaxAmount, object pnPump, object pnPipe, bool bnWildcard)
{
	//Search liquid to pump
	if (bnWildcard)
	{
		var ptBarrel = FindObject(Find_Container(this), Find_Func("IsBarrel"), Find_Func("IsBarrelForMaterial", sznMaterial), Find_Not(Find_Func("BarrelIsEmpty")));
		var sztMaterial="";
		if (ptBarrel)
			sztMaterial = ptBarrel->GetBarrelMaterial();
		//Nothing to pump
		if (sztMaterial == "")
			return ["", 0];
		sznMaterial = sztMaterial;
	}
	var itFound = 0;
	for (var ptBarrel in FindObjects(Find_Container(this), Find_Func("IsBarrel"), Find_Func("IsBarrelForMaterial", sznMaterial), Find_Not(Find_Func("BarrelIsEmpty")))) 
	{
		var atFound = ptBarrel->GetLiquid(sznMaterial, inMaxAmount - itFound, this);
		//Crazy stuff happend?
		itFound += BoundBy(atFound[1], 0, inMaxAmount - itFound);
		if (itFound == inMaxAmount)
			break;
	}
	return [sznMaterial, itFound];
}
开发者ID:Meowtimer,项目名称:openclonk,代码行数:36,代码来源:Script.c


示例19: Initialize

protected func Initialize() 
{
  // Alle Fische anfangs umfärben
  var pFish;
  while(pFish=FindObject(FISH,0,0,0,0,0,0,0,0,pFish))
    Colorize(pFish);
}
开发者ID:ckanibal,项目名称:clonk-content,代码行数:7,代码来源:Script.c


示例20: SetArrow

global func SetArrow(iX,iY) 
{
  if(FindObject2(Find_ID(_AR1),Find_AtPoint(iX, iY - 16))) return 0;
  RemoveObject(FindObject(_AR1));
  CreateObject(_AR1,iX,iY,-1);
  arrow_target = 0;
}
开发者ID:lluchs,项目名称:ClonkMars,代码行数:7,代码来源:Script.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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