本文整理汇总了C++中TThinkerIterator::Next方法的典型用法代码示例。如果您正苦于以下问题:C++ TThinkerIterator::Next方法的具体用法?C++ TThinkerIterator::Next怎么用?C++ TThinkerIterator::Next使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TThinkerIterator
的用法示例。
在下文中一共展示了TThinkerIterator::Next方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: EV_CeilingCrushStop
bool EV_CeilingCrushStop (int tag, bool remove)
{
bool rtn = false;
DCeiling *scan;
TThinkerIterator<DCeiling> iterator;
scan = iterator.Next();
while (scan != nullptr)
{
DCeiling *next = iterator.Next();
if (scan->m_Tag == tag && scan->m_Direction != 0)
{
if (!remove)
{
SN_StopSequence(scan->m_Sector, CHAN_CEILING);
scan->m_OldDirection = scan->m_Direction;
scan->m_Direction = 0; // in-stasis;
}
else
{
scan->Destroy();
}
rtn = true;
}
scan = next;
}
return rtn;
}
示例2: G_UnSnapshotLevel
void G_UnSnapshotLevel (bool hubLoad)
{
if (level.info->Snapshot.mBuffer == nullptr)
return;
if (level.info->isValid())
{
FSerializer arc;
if (!arc.OpenReader(&level.info->Snapshot))
{
I_Error("Failed to load savegame");
return;
}
G_SerializeLevel (arc, hubLoad);
level.FromSnapshot = true;
TThinkerIterator<APlayerPawn> it;
APlayerPawn *pawn, *next;
next = it.Next();
while ((pawn = next) != 0)
{
next = it.Next();
if (pawn->player == NULL || pawn->player->mo == NULL || !playeringame[pawn->player - players])
{
int i;
// If this isn't the unmorphed original copy of a player, destroy it, because it's extra.
for (i = 0; i < MAXPLAYERS; ++i)
{
if (playeringame[i] && players[i].morphTics && players[i].mo->tracer == pawn)
{
break;
}
}
if (i == MAXPLAYERS)
{
pawn->Destroy ();
}
}
}
}
// No reason to keep the snapshot around once the level's been entered.
level.info->Snapshot.Clean();
if (hubLoad)
{
// Unlock ACS global strings that were locked when the snapshot was made.
FBehavior::StaticUnlockLevelVarStrings();
}
}
示例3: G_UnSnapshotLevel
void G_UnSnapshotLevel (bool hubLoad)
{
if (level.info->snapshot == NULL)
return;
if (level.info->isValid())
{
SaveVersion = level.info->snapshotVer;
level.info->snapshot->Reopen ();
FArchive arc (*level.info->snapshot);
if (hubLoad)
arc.SetHubTravel ();
G_SerializeLevel (arc, hubLoad);
arc.Close ();
level.FromSnapshot = true;
TThinkerIterator<APlayerPawn> it;
APlayerPawn *pawn, *next;
next = it.Next();
while ((pawn = next) != 0)
{
next = it.Next();
if (pawn->player == NULL || pawn->player->mo == NULL || !playeringame[pawn->player - players])
{
int i;
// If this isn't the unmorphed original copy of a player, destroy it, because it's extra.
for (i = 0; i < MAXPLAYERS; ++i)
{
if (playeringame[i] && players[i].morphTics && players[i].mo->tracer == pawn)
{
break;
}
}
if (i == MAXPLAYERS)
{
pawn->Destroy ();
}
}
}
}
// No reason to keep the snapshot around once the level's been entered.
level.info->ClearSnapshot();
if (hubLoad)
{
// Unlock ACS global strings that were locked when the snapshot was made.
FBehavior::StaticUnlockLevelVarStrings();
}
}
示例4:
void ASorcerer2::BeginPlay ()
{
TThinkerIterator<ABossSpot> iterator;
ABossSpot *spot;
Super::BeginPlay ();
NumBossSpots = 0;
spot = iterator.Next ();
FirstBossSpot = static_cast<ABossSpot *> (spot);
while (spot)
{
NumBossSpots++;
spot->NextSpot = iterator.Next ();
spot = spot->NextSpot;
}
}
示例5: while
DEFINE_ACTION_FUNCTION(AActor, A_BrainDie)
{
// [RH] If noexit, then don't end the level.
if ((deathmatch || alwaysapplydmflags) && (dmflags & DF_NO_EXIT))
return;
// New dmflag: Kill all boss spawned monsters before ending the level.
if (dmflags2 & DF2_KILLBOSSMONST)
{
int count; // Repeat until we have no more boss-spawned monsters.
do // (e.g. Pain Elementals can spawn more to kill upon death.)
{
TThinkerIterator<AActor> it;
AActor *mo;
count = 0;
while ((mo = it.Next()))
{
if (mo->health > 0 && mo->flags4 & MF4_BOSSSPAWNED)
{
P_DamageMobj(mo, self, self, mo->health, NAME_None,
DMG_NO_ARMOR|DMG_FORCED|DMG_THRUSTLESS|DMG_NO_FACTOR);
count++;
}
}
} while (count != 0);
}
G_ExitLevel (0, false);
}
示例6: PrintFilteredActorList
static void PrintFilteredActorList(const ActorTypeChecker IsActorType, const char *FilterName)
{
AActor *mo;
const PClass *FilterClass = NULL;
if (FilterName != NULL)
{
FilterClass = PClass::FindClass(FilterName);
if (FilterClass == NULL || FilterClass->ActorInfo == NULL)
{
Printf("%s is not an actor class.\n", FilterName);
return;
}
}
TThinkerIterator<AActor> it;
while ( (mo = it.Next()) )
{
if ((FilterClass == NULL || mo->IsA(FilterClass)) && IsActorType(mo))
{
Printf ("%s at (%d,%d,%d)\n",
mo->GetClass()->TypeName.GetChars(),
mo->x >> FRACBITS, mo->y >> FRACBITS, mo->z >> FRACBITS);
}
}
示例7: PostBeginPlay
void ASoundSequence::PostBeginPlay ()
{
FName slot = SN_GetSequenceSlot (args[0], SEQ_ENVIRONMENT);
if (slot != NAME_None)
{ // This is a slotted sound, so add it to the master for that slot
ASoundSequenceSlot *master;
TThinkerIterator<ASoundSequenceSlot> locator;
while (NULL != (master = locator.Next ()))
{
if (master->Sequence->GetSequenceName() == slot)
{
break;
}
}
if (master == NULL)
{
master = Spawn<ASoundSequenceSlot> (0, 0, 0, NO_REPLACE);
master->Sequence = SN_StartSequence (master, slot, 0);
GC::WriteBarrier(master, master->Sequence);
}
master->Sequence->AddChoice (args[0], SEQ_ENVIRONMENT);
Destroy ();
}
}
示例8: StaticGetQuakeIntensity
int DEarthquake::StaticGetQuakeIntensity (AActor *victim)
{
int intensity = 0;
TThinkerIterator<DEarthquake> iterator (STAT_EARTHQUAKE);
DEarthquake *quake;
if (victim->player != NULL && (victim->player->cheats & CF_NOCLIP))
{
return 0;
}
while ( (quake = iterator.Next()) != NULL)
{
if (quake->m_Spot != NULL)
{
fixed_t dist = P_AproxDistance (victim->x - quake->m_Spot->x,
victim->y - quake->m_Spot->y);
if (dist < quake->m_TremorRadius)
{
if (intensity < quake->m_Intensity)
intensity = quake->m_Intensity;
}
}
}
return intensity;
}
示例9: Die
void AMinotaurFriend::Die (AActor *source, AActor *inflictor, int dmgflags)
{
Super::Die (source, inflictor, dmgflags);
if (tracer && tracer->health > 0 && tracer->player)
{
// Search thinker list for minotaur
TThinkerIterator<AMinotaurFriend> iterator;
AMinotaurFriend *mo;
while ((mo = iterator.Next()) != NULL)
{
if (mo->health <= 0) continue;
// [RH] Minotaurs can't be morphed, so this isn't needed
//if (!(mo->flags&MF_COUNTKILL)) continue; // for morphed minotaurs
if (mo->flags&MF_CORPSE) continue;
if (mo->StartTime >= 0 && (level.maptime - StartTime) >= MAULATORTICS) continue;
if (mo->tracer != NULL && mo->tracer->player == tracer->player) break;
}
if (mo == NULL)
{
AInventory *power = tracer->FindInventory(PClass::FindActor("PowerMinotaur"));
if (power != NULL)
{
power->Destroy ();
}
}
}
}
示例10: EV_StopPlat
void EV_StopPlat (int tag, bool remove)
{
DPlat *scan;
TThinkerIterator<DPlat> iterator;
scan = iterator.Next();
while (scan != nullptr)
{
DPlat *next = iterator.Next();
if (scan->m_Status != DPlat::in_stasis && scan->m_Tag == tag)
{
if (!remove) scan->Stop();
else scan->Destroy();
}
scan = next;
}
}
示例11: gl_RecreateAllAttachedLights
void gl_RecreateAllAttachedLights()
{
TThinkerIterator<AActor> it;
AActor * a;
while ((a=it.Next()))
{
gl_SetActorLights(a);
}
}
示例12: P_ActivateInStasis
void P_ActivateInStasis (int tag)
{
DPlat *scan;
TThinkerIterator<DPlat> iterator;
while ( (scan = iterator.Next ()) )
{
if (scan->m_Tag == tag && scan->m_Status == DPlat::in_stasis)
scan->Reactivate ();
}
}
示例13: EV_StopPlat
void EV_StopPlat (int tag)
{
DPlat *scan;
TThinkerIterator<DPlat> iterator;
while ( (scan = iterator.Next ()) )
{
if (scan->m_Status != DPlat::in_stasis && scan->m_Tag == tag)
scan->Stop ();
}
}
示例14: A_WakeOracleSpectre
void A_WakeOracleSpectre (AActor *self)
{
TThinkerIterator<AAlienSpectre3> it;
AActor *spectre = it.Next();
if (spectre != NULL)
{
spectre->Sector->SoundTarget = spectre->LastHeard = self->LastHeard;
spectre->target = self->target;
spectre->SetState (spectre->SeeState);
}
}
示例15: EV_StopLightEffect
void EV_StopLightEffect (int tag)
{
TThinkerIterator<DLighting> iterator;
DLighting *effect;
while ((effect = iterator.Next()) != NULL)
{
if (effect->GetSector()->tag == tag)
{
effect->Destroy();
}
}
}