Search in sources :

Example 1 with MapQueueFillEvent

use of pl.themolka.arcade.map.queue.MapQueueFillEvent in project Arcade2 by ShootGame.

the class SimpleGameManager method fillDefaultQueue.

@Override
public void fillDefaultQueue() {
    Node node = this.plugin.getSettings().getData().child("queue");
    if (node == null) {
        node = Node.empty();
    }
    for (Node mapNode : node.children("map")) {
        String directory = mapNode.propertyValue("directory");
        String mapName = mapNode.getValue();
        OfflineMap map = null;
        if (directory != null) {
            map = this.plugin.getMaps().getContainer().getMapByDirectory(directory);
        } else if (mapName != null) {
            map = this.plugin.getMaps().getContainer().getMap(mapName);
        }
        if (map != null) {
            queue.addMap(map);
        }
    }
    this.postEvent(new MapQueueFillEvent(this.plugin, this.getQueue()));
}
Also used : MapQueueFillEvent(pl.themolka.arcade.map.queue.MapQueueFillEvent) Node(pl.themolka.arcade.dom.Node) OfflineMap(pl.themolka.arcade.map.OfflineMap)

Aggregations

Node (pl.themolka.arcade.dom.Node)1 OfflineMap (pl.themolka.arcade.map.OfflineMap)1 MapQueueFillEvent (pl.themolka.arcade.map.queue.MapQueueFillEvent)1