Example usage for com.badlogic.gdx.utils LongMap keys

List of usage examples for com.badlogic.gdx.utils LongMap keys

Introduction

In this page you can find the example usage for com.badlogic.gdx.utils LongMap keys.

Prototype

public Keys keys() 

Source Link

Document

Returns an iterator for the keys in the map.

Usage

From source file:net.spookygames.gdx.sfx.SfxSoundPlayer.java

License:Open Source License

public void update(float delta) {
    SfxSoundInstance sound;/* w  w w  . j  a va2  s  .com*/
    LongMap.Keys indexes = sounds.keys();

    while (indexes.hasNext) {
        long index = indexes.next();
        sound = sounds.get(index);
        if (sound.update(delta)) {
            sounds.remove(index);
        }
    }
}

From source file:net.spookygames.gdx.sfx.SfxSoundPlayer.java

License:Open Source License

public void stop() {
    LongMap.Keys indexes = sounds.keys();

    while (indexes.hasNext) {
        sounds.remove(indexes.next()).stop();
    }
}

From source file:net.spookygames.gdx.sfx.SfxSoundPlayer.java

License:Open Source License

public void pause() {
    SfxSoundInstance sound;/*from   w  w  w .  ja v  a 2s  .  c  o  m*/
    LongMap.Keys indexes = sounds.keys();

    while (indexes.hasNext) {
        long index = indexes.next();
        sound = sounds.get(index);
        if (sound.isLooping()) {
            sound.pause();
        } else {
            sounds.remove(index).stop();
        }
    }
}