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


C++ SListIterator::Forth方法代码示例

本文整理汇总了C++中SListIterator::Forth方法的典型用法代码示例。如果您正苦于以下问题:C++ SListIterator::Forth方法的具体用法?C++ SListIterator::Forth怎么用?C++ SListIterator::Forth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SListIterator的用法示例。


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

示例1: DestroyInterface

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;
}
开发者ID:stuckie,项目名称:plightoftheweedunks,代码行数:27,代码来源:SDLAudio.cpp

示例2: 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;
}
开发者ID:stuckie,项目名称:plightoftheweedunks,代码行数:28,代码来源:SDLAudio.cpp

示例3:

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;
}
开发者ID:stuckie,项目名称:plightoftheweedunks,代码行数:27,代码来源:SDLEntity2D.cpp

示例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;
}
开发者ID:stuckie,项目名称:plightoftheweedunks,代码行数:28,代码来源:SDLAudio.cpp

示例5: 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);
    }
}
开发者ID:stuckie,项目名称:plightoftheweedunks,代码行数:9,代码来源:CInterpret.cpp

示例6: UpdateEntities

bool MEntity::UpdateEntities( void )
{
    /** Update Entities */
    SListIterator<IEntity*> EntityListITR = EntityList.GetIterator();
    for( EntityListITR.Start(); EntityListITR.Valid(); EntityListITR.Forth() )
        EntityListITR.Item()->Update();

    return true;
}
开发者ID:stuckie,项目名称:plightoftheweedunks,代码行数:9,代码来源:MEntity.cpp

示例7: CheckVar

std::string MEntity::CheckVar ( std::string Name, std::string VarName )
{
    SListIterator<IEntity*> EntityListITR = EntityList.GetIterator();
    for( EntityListITR.Start(); EntityListITR.Valid(); EntityListITR.Forth() )
        if(EntityListITR.Item()->GetName().compare(Name)==0)
            return EntityListITR.Item()->CheckVar(VarName);

    SGZLogger.warn("Entity %s does not exist!\n", Name.c_str());
    return "none";
}
开发者ID:stuckie,项目名称:plightoftheweedunks,代码行数:10,代码来源:MEntity.cpp

示例8: NextEvent

void CInterpret::NextEvent( void )
{
    SListIterator<IEvent*> EventListITR = EventList.GetIterator();
    for( EventListITR.Start(); EventListITR.Valid(); EventListITR.Forth() )
    {
        if(EventListITR.Item()->doEvent())
            EventListITR.Item()->handled(true);
    }
    CleanEvents();
}
开发者ID:stuckie,项目名称:plightoftheweedunks,代码行数:10,代码来源:CInterpret.cpp

示例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;
}
开发者ID:stuckie,项目名称:plightoftheweedunks,代码行数:10,代码来源:MEntity.cpp

示例10: GetAnimation

std::string MEntity::GetAnimation( std::string Name )
{
    /** Return the current X Position */
    SListIterator<IEntity*> EntityListITR = EntityList.GetIterator();
    for( EntityListITR.Start(); EntityListITR.Valid(); EntityListITR.Forth() )
        if(EntityListITR.Item()->GetName().compare(Name)==0)
            return EntityListITR.Item()->GetAnimation();

    SGZLogger.warn("Entity %s does not exist!\n", Name.c_str());
    return "none";
}
开发者ID:stuckie,项目名称:plightoftheweedunks,代码行数:11,代码来源:MEntity.cpp

示例11: GetDepth

SGZSCALER MEntity::GetDepth ( std::string Name )
{
    /** Return the current width */
    SListIterator<IEntity*> EntityListITR = EntityList.GetIterator();
    for( EntityListITR.Start(); EntityListITR.Valid(); EntityListITR.Forth() )
        if(EntityListITR.Item()->GetName().compare(Name)==0)
            return EntityListITR.Item()->GetDepth();

    SGZLogger.warn("Entity %s does not exist!\n", Name.c_str());
    return 0;
}
开发者ID:stuckie,项目名称:plightoftheweedunks,代码行数:11,代码来源:MEntity.cpp

示例12: while

MEntity::~MEntity()
{
    /** Destructor */
    SListIterator<IEntity*> EntityListITR = EntityList.GetIterator();

    EntityListITR.Start();
    while (EntityListITR.Valid())
    {
        EntityList.Remove(EntityListITR);
        EntityListITR.Forth();
    }
}
开发者ID:stuckie,项目名称:plightoftheweedunks,代码行数:12,代码来源:MEntity.cpp

示例13: MoveDeltaZ

bool MEntity::MoveDeltaZ ( std::string Name, SGZVECTORVAL amount )
{
    SListIterator<IEntity*> EntityListITR = EntityList.GetIterator();
    for( EntityListITR.Start(); EntityListITR.Valid(); EntityListITR.Forth() )
        if(EntityListITR.Item()->GetName().compare(Name)==0)
        {
            EntityListITR.Item()->MoveDeltaZ( amount );
            return true;
        }

    SGZLogger.warn("Entity %s does not exist!\n", Name.c_str());
    return false;
}
开发者ID:stuckie,项目名称:plightoftheweedunks,代码行数:13,代码来源:MEntity.cpp

示例14: DeleteAnimation

bool MEntity::DeleteAnimation( std::string Name, std::string AnimName )
{
    SListIterator<IEntity*> EntityListITR = EntityList.GetIterator();
    for( EntityListITR.Start(); EntityListITR.Valid(); EntityListITR.Forth() )
        if(EntityListITR.Item()->GetName().compare(Name)==0)
        {
            EntityListITR.Item()->DeleteAnimation( AnimName );
            return true;
        }

    SGZLogger.warn("Entity %s does not exist!\n", Name.c_str());
    return false;
}
开发者ID:stuckie,项目名称:plightoftheweedunks,代码行数:13,代码来源:MEntity.cpp

示例15: ChangeVar

bool MEntity::ChangeVar ( std::string Name, std::string VarName, std::string Value )
{
    SListIterator<IEntity*> EntityListITR = EntityList.GetIterator();
    for( EntityListITR.Start(); EntityListITR.Valid(); EntityListITR.Forth() )
        if(EntityListITR.Item()->GetName().compare(Name)==0)
        {
            EntityListITR.Item()->ChangeVar(VarName, Value);
            return true;
        }

    SGZLogger.warn("Entity %s does not exist!\n", Name.c_str());
    return false;
}
开发者ID:stuckie,项目名称:plightoftheweedunks,代码行数:13,代码来源:MEntity.cpp


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