Files
SteamWar/TowerRun/src/de/steamwar/towerrun/winconditions/WinCondition.java
T
2026-05-16 22:23:00 +02:00

55 lines
1.5 KiB
Java

/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2025 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.towerrun.winconditions;
import de.steamwar.towerrun.state.GameStateBukkitListener;
import de.steamwar.towerrun.state.GameStates;
import lombok.Getter;
import lombok.Setter;
import java.util.EnumSet;
@Getter
public abstract class WinCondition extends GameStateBukkitListener {
private final String name;
@Setter
private boolean active = false;
protected WinCondition(String name) {
super(EnumSet.of(GameStates.RUNNING));
this.name = name;
}
@Override
public void enable() {
if (active) {
super.enable();
}
}
@Override
public void disable() {
if (active) {
super.disable();
}
}
}