本文整理汇总了C++中SListIterator类的典型用法代码示例。如果您正苦于以下问题:C++ SListIterator类的具体用法?C++ SListIterator怎么用?C++ SListIterator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SListIterator类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadSFXFile
bool SDLAudio::LoadSFXFile( std::string Filename, std::string SFXName )
{
/** Check to see if we've already loaded it */
SListIterator<SGZSound*> SFXListITR = SFXList.GetIterator();
for( SFXListITR.Start(); SFXListITR.Valid(); SFXListITR.Forth() )
if((SFXListITR.Item()->Name.compare(SFXName))==0)
{
SGZLogger.debug("AudioMAN: SFX \"%s\" already loaded!\n", SFXName.c_str());
return false;
}
/** Load a sound effect to play */
SGZLogger.debug("AudioMAN: Loading SFX \"%s\" as %s\n", Filename.c_str(), SFXName.c_str());
SGZSound *Effect;
Effect = new SGZSound;
Effect->Name = SFXName;
Effect->Data = Mix_LoadWAV(Filename.c_str());
if(Effect->Data == NULL)
{
SGZLogger.warn("AudioMAN: Failed to load SFX: %s\n", Filename.c_str());
delete Effect;
return false;
}
else
SFXList.Append(Effect);
return true;
}
示例2: while
bool SDLAudio::DestroyInterface(void)
{
/** Destroy a client interface */
SListIterator<SGZMusic*> MusicListITR = MusicList.GetIterator();
MusicListITR.Start();
while (MusicListITR.Valid())
{
Mix_FreeMusic(MusicListITR.Item()->Data);
MusicList.Remove(MusicListITR);
MusicListITR.Forth();
}
SListIterator<SGZSound*> SFXListITR = SFXList.GetIterator();
SFXListITR.Start();
while (SFXListITR.Valid())
{
Mix_FreeChunk(SFXListITR.Item()->Data);
SFXList.Remove(SFXListITR);
SFXListITR.Forth();
}
Mix_CloseAudio();
return true;
}
示例3: spqrproper
SList<node>& DynamicSPQRForest::findPathSPQR (node sH, node tH, node& rT) const
{
SList<node>& pT = *OGDF_NEW SList<node>;
node sT = spqrproper(sH->firstAdj()->theEdge());
node tT = spqrproper(tH->firstAdj()->theEdge());
node nT = findNCASPQR(sT,tT);
while (sT!=nT) {
edge eH = m_tNode_hRefEdge[sT];
node uH = eH->source();
node vH = eH->target();
if (uH!=sH && vH!=sH) pT.pushBack(sT);
if (uH==tH || vH==tH) { rT = sT; return pT; }
sT = spqrproper(m_hEdge_twinEdge[eH]);
}
SListIterator<node> iT = pT.rbegin();
while (tT!=nT) {
edge eH = m_tNode_hRefEdge[tT];
node uH = eH->source();
node vH = eH->target();
if (uH!=tH && vH!=tH) {
if (iT.valid()) pT.insertAfter(tT,iT);
else pT.pushFront(tT);
}
if (uH==sH || vH==sH) { rT = tT; return pT; }
tT = spqrproper(m_hEdge_twinEdge[eH]);
}
if (iT.valid()) pT.insertAfter(nT,iT);
else pT.pushFront(nT);
rT = nT; return pT;
}
示例4: LoadMUSFile
bool SDLAudio::LoadMUSFile( std::string Filename, std::string MUSName )
{
/** Check to see if we've already loaded it */
SListIterator<SGZMusic*> MusicListITR = MusicList.GetIterator();
for( MusicListITR.Start(); MusicListITR.Valid(); MusicListITR.Forth() )
if((MusicListITR.Item()->Name.compare(MUSName))==0)
{
SGZLogger.debug("AudioMAN: SFX: %s already loaded!\n", MUSName.c_str());
return false;
}
/** Load a music to play */
SGZLogger.debug("AudioMAN: Loading MUS: %s as %s\n", Filename.c_str(), MUSName.c_str());
SGZMusic *Music;
Music = new SGZMusic;
Music->Name = MUSName;
Music->Data = Mix_LoadMUS(Filename.c_str());
if(Music->Data == NULL)
{
SGZLogger.warn("AudioMAN: Failed to load MUS: %s\n", Filename.c_str());
delete Music;
return false;
}
else
MusicList.Append(Music);
return true;
}
示例5: Initialize
// Initializes a PQTree by a set of leaves that will korrespond to
// the set of Keys stored in leafKeys.
int PlanarPQTree::Initialize(SListPure<PlanarLeafKey<IndInfo*>*> &leafKeys)
{
SListIterator<PlanarLeafKey<IndInfo*>* > it;
SListPure<PQLeafKey<edge,IndInfo*,bool>*> castLeafKeys;
for (it = leafKeys.begin(); it.valid(); ++it)
castLeafKeys.pushBack((PQLeafKey<edge,IndInfo*,bool>*) *it);
return PQTree<edge,IndInfo*,bool>::Initialize(castLeafKeys);
}
示例6: CleanEvents
void CInterpret::CleanEvents( void )
{
SListIterator<IEvent*> EventListITR = EventList.GetIterator();
for( EventListITR.Start(); EventListITR.Valid(); EventListITR.Forth() )
{
if(EventListITR.Item()->handled(false))
EventList.Remove(EventListITR);
}
}
示例7: checkExist
bool MTexture::checkExist ( const std::string &Name )
{
SListIterator<TextureObj*> TextureITR = mTextureList.getIterator();
for( TextureITR.start(); TextureITR.valid(); TextureITR.forth() )
if(TextureITR.item()->mName.compare(Name)==0)
return true;
return false;
}
示例8: UpdateEntities
bool MEntity::UpdateEntities( void )
{
/** Update Entities */
SListIterator<IEntity*> EntityListITR = EntityList.GetIterator();
for( EntityListITR.Start(); EntityListITR.Valid(); EntityListITR.Forth() )
EntityListITR.Item()->Update();
return true;
}
示例9: CheckExist
bool MEntity::CheckExist(std::string Name)
{
/** Check an Entity */
SListIterator<IEntity*> EntityListITR = EntityList.GetIterator();
for( EntityListITR.Start(); EntityListITR.Valid(); EntityListITR.Forth() )
if(EntityListITR.Item()->GetName().compare(Name)==0)
return true;
return false;
}
示例10:
bool SDLEntity2D::LoadFrame ( std::string Name, std::string TexName, std::string MaskName, int FrameDelay, int x, int y, SGZCOLOUR ColourKey )
{
/// Load up a Texture into an Animation
SListIterator<SGZAnimGroup2D*> AnimListITR = AnimList.GetIterator();
for( AnimListITR.Start(); AnimListITR.Valid(); AnimListITR.Forth() )
if((AnimListITR.Item()->AnimName.compare(Name))==0)
{
SGZAnimFrame2D *Frame = new SGZAnimFrame2D;
Frame->TextureName = TexName;
Frame->MaskName = "none";
Frame->delay = FrameDelay;
Frame->u = x;
Frame->v = y;
Frame->colkey = ColourKey;
AnimListITR.Item()->FrameList.Append(Frame);
AnimListITR.Item()->AnimNum++;
AnimListITR.Item()->FrameITR = AnimListITR.Item()->FrameList.GetIterator();
if(!SGZInterpret.accessServer()->World()->accessTextureManager()->CheckExist(TexName))
SGZLogger.warn("Texture %s has not been loaded yet.. make sure it is before calling this frame!", TexName.c_str());
return true;
}
SGZLogger.warn("Animation \"%s\" does not exist!\n",Name.c_str());
return false;
}
示例11:
bool SDLEntity2D::LoadFrame ( std::string Name, std::string TexName, std::string MaskName, int FrameDelay, int x, int y, SGZ::RGBCOLOUR ColourKey )
{
/// Load up a Texture into an Animation
SListIterator<SGZAnimGroup2D*> AnimListITR = AnimList.getIterator();
for( AnimListITR.start(); AnimListITR.valid(); AnimListITR.forth() )
if((AnimListITR.item()->AnimName.compare(Name))==0)
{
SGZAnimFrame2D *Frame = new SGZAnimFrame2D;
Frame->TextureName = TexName;
Frame->MaskName = MaskName;
Frame->delay = FrameDelay;
Frame->u = x;
Frame->v = y;
Frame->colkey = ColourKey;
AnimListITR.item()->FrameList.append(Frame);
AnimListITR.item()->AnimNum++;
AnimListITR.item()->FrameITR = AnimListITR.item()->FrameList.getIterator();
if(!manTextures->checkExist(TexName))
SGZ::Logger.log( SGZLOG::Warning, "Texture " + TexName + " has not been loaded yet.. make sure it is before calling this frame!");
return true;
}
SGZ::Logger.log( SGZLOG::Warning, "Animation \"" + Name + "\" does not exist!\n");
return false;
}
示例12:
MTexture::~MTexture()
{
/** Destructor */
SListIterator<TextureObj*> TextureITR = mTextureList.getIterator();
TextureITR.start();
while (TextureITR.valid())
{
mTextureList.remove(TextureITR);
TextureITR.forth();
}
}
示例13: while
MEntity::~MEntity()
{
/** Destructor */
SListIterator<IEntity*> EntityListITR = EntityList.GetIterator();
EntityListITR.Start();
while (EntityListITR.Valid())
{
EntityList.Remove(EntityListITR);
EntityListITR.Forth();
}
}
示例14: delTexture
bool MTexture::delTexture( const std::string &Name )
{
SListIterator<TextureObj*> TextureITR = mTextureList.getIterator();
for( TextureITR.start(); TextureITR.valid(); TextureITR.forth() )
if(TextureITR.item()->mName.compare(Name)==0)
{
mTextureList.remove(TextureITR);
return true;
}
SGZ::Logger.log( SGZLOG::Warning, "Texture " + Name + " does not exist!\n");
return false;
}
示例15: DelEntity
bool MEntity::DelEntity(std::string Name)
{
/** Remove an Entity */
SListIterator<IEntity*> EntityListITR = EntityList.GetIterator();
for( EntityListITR.Start(); EntityListITR.Valid(); EntityListITR.Forth() )
if(EntityListITR.Item()->GetName().compare(Name)==0)
{
EntityList.Remove(EntityListITR);
return true;
}
SGZLogger.warn("Entity %s does not exist!\n", Name.c_str());
return false;
}