package de.steamwar.fightsystem.winconditions; import de.steamwar.fightsystem.Config; import de.steamwar.fightsystem.FightSystem; import de.steamwar.fightsystem.countdown.TimeOverCountdown; import de.steamwar.fightsystem.states.FightState; import java.util.EnumSet; public class WinconditionTimeout extends Wincondition { private TimeOverCountdown countdown; public WinconditionTimeout() { super(Config.Timeout, EnumSet.of(FightState.RUNNING, FightState.ENTERN)); } @Override public void enable() { countdown = new TimeOverCountdown(() -> FightSystem.setSpectateState(null, "Timeout")); } @Override public void disable() { countdown.disable(); } }