Search in sources :

Example 1 with GameManager

use of pl.themolka.arcade.game.GameManager in project Arcade2 by ShootGame.

the class MapCommands method setNextMap.

private void setNextMap(Sender sender, OfflineMap map, boolean next) {
    GameManager games = this.plugin.getGames();
    games.setNextRestart(false);
    if (next) {
        games.getQueue().setNextMap(map);
        sender.sendSuccess(map.getName() + " has been set to next in the queue.");
    } else {
        games.getQueue().addMap(map);
        sender.sendSuccess(map.getName() + " has been added to the queue.");
    }
}
Also used : GameManager(pl.themolka.arcade.game.GameManager)

Example 2 with GameManager

use of pl.themolka.arcade.game.GameManager in project Arcade2 by ShootGame.

the class MatchGame method onCycleCountdownAutoStart.

@Handler(priority = Priority.LOWEST)
public void onCycleCountdownAutoStart(MatchEndedEvent event) {
    if (!this.isAutoCycle()) {
        // auto cycle is disabled
        return;
    }
    GameManager games = event.getPlugin().getGames();
    Countdown countdown;
    if (games.isNextRestart()) {
        countdown = games.getRestartCountdown();
        if (!countdown.isTaskRunning()) {
            ((RestartCountdown) countdown).setDefaultDuration();
        }
    } else {
        countdown = games.getCycleCountdown();
        if (!countdown.isTaskRunning()) {
            ((CycleCountdown) countdown).setDefaultDuration();
        }
    }
    if (!countdown.isTaskRunning()) {
        countdown.countSync();
    }
}
Also used : GameManager(pl.themolka.arcade.game.GameManager) RestartCountdown(pl.themolka.arcade.game.RestartCountdown) CycleCountdown(pl.themolka.arcade.cycle.CycleCountdown) RestartCountdown(pl.themolka.arcade.game.RestartCountdown) CycleCountdown(pl.themolka.arcade.cycle.CycleCountdown) Countdown(pl.themolka.arcade.task.Countdown) Handler(net.engio.mbassy.listener.Handler)

Aggregations

GameManager (pl.themolka.arcade.game.GameManager)2 Handler (net.engio.mbassy.listener.Handler)1 CycleCountdown (pl.themolka.arcade.cycle.CycleCountdown)1 RestartCountdown (pl.themolka.arcade.game.RestartCountdown)1 Countdown (pl.themolka.arcade.task.Countdown)1