Example usage for com.badlogic.gdx.utils ObjectSet ObjectSet

List of usage examples for com.badlogic.gdx.utils ObjectSet ObjectSet

Introduction

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

Prototype

public ObjectSet(ObjectSet set) 

Source Link

Document

Creates a new set identical to the specified set.

Usage

From source file:com.dongbat.invasion.util.PriorityQueue.java

/**
 * Creates a {@code PriorityQueue} with the specified initial capacity that
 * orders its elements according to their
 * {@linkplain Comparable natural ordering}.
 *
 * @param initialCapacity the initial capacity for this priority queue
 */// www  .j av a2s  .c  om
public PriorityQueue(int initialCapacity) {
    this.queue = new Object[initialCapacity];
    this.set = new ObjectSet<E>(initialCapacity);
}

From source file:com.kotcrab.vis.runtime.util.VisBagUtils.java

License:Apache License

public static <E> ObjectSet<E> toSet(ImmutableBag<E> bag) {
    ObjectSet<E> array = new ObjectSet<E>(bag.size());

    for (E element : bag)
        array.add(element);//from  w w w.j  ava 2 s .  com

    return array;
}

From source file:com.vlaaad.common.tutorial.Tutorial.java

License:Open Source License

public static void killAll() {
    if (runningTutorials.size == 0)
        return;//from w  w w.j a  va2  s . c o  m
    ObjectSet<Tutorial> tuts = new ObjectSet<Tutorial>(runningTutorials);
    for (Tutorial tutorial : tuts) {
        try {
            tutorial.cancel();
        } catch (UnsupportedOperationException e) {
            Logger.debug("failed to cancel tutorial", e);
        }
    }
}

From source file:com.vlaaad.dice.services.RoomController.java

License:Open Source License

@Override
public void onRoomConnected(final int statusCode, final Room room) {
    Logger.log("room connected, status ok: " + (statusCode == GamesStatusCodes.STATUS_OK));
    if (statusCode != GamesStatusCodes.STATUS_OK) {
        die(false, Config.thesaurus.localize("disconnect-game-services-error"));
        return;//from w w  w . ja  v a2  s .c  o m
    }
    RoomController.this.room = room;
    session.setVariant(room.getVariant());
    String playerId = room.getParticipantId(Games.Players.getCurrentPlayerId(multiplayer.client));

    for (Participant participant : room.getParticipants()) {
        if (participant.getStatus() != Participant.STATUS_JOINED)
            continue;
        if (participant.getParticipantId().equals(playerId)) {
            me = new MultiplayerParticipant(participant);
        } else {
            others.add(new MultiplayerParticipant(participant));
        }
    }
    all.put(me.getId(), me);
    for (MultiplayerParticipant p : others) {
        all.put(p.getId(), p);
    }
    publicOthers = new ObjectSet<IParticipant>(others);
    publicAll = new ObjectMap<String, IParticipant>(all);

    multiplayer.updateInvites();
    Logger.log("  - room: " + RoomController.this.toString(room));
}