本文整理匯總了C++中FindObject函數的典型用法代碼示例。如果您正苦於以下問題:C++ FindObject函數的具體用法?C++ FindObject怎麽用?C++ FindObject使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了FindObject函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
}
}
示例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();
}
示例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;
}
示例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();
}
}
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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();
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}