27 lines
804 B
Java
27 lines
804 B
Java
package xyz.stachel.zombiesutils.game;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import xyz.stachel.zombiesutils.game.GameMode.Map;
|
|
import xyz.stachel.zombiesutils.handlers.Location;
|
|
|
|
public class GameManager {
|
|
private final HashMap<String, Game> games = new HashMap<>();
|
|
|
|
private void addGame(final String serverNumber, final GameMode mode, final int round) {
|
|
this.games.put(serverNumber, new Game(new GameFile(serverNumber), mode));
|
|
}
|
|
|
|
public void onRound(final int round) {
|
|
final String sn = Location.getServerNumber();
|
|
final String mode = Location.getMode();
|
|
if (sn == null || mode == null || !mode.startsWith("ZOMBIES")) return;
|
|
|
|
if (!games.containsKey(sn)) addGame(sn, new GameMode(Map.DEAD_END), round);
|
|
else games.get(sn).split(round);
|
|
}
|
|
|
|
public Game getGame() {
|
|
|
|
}
|
|
}
|