mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
make the combatmanager an enum
This commit is contained in:
parent
5b21f34941
commit
ce26e5c8dd
2 changed files with 4 additions and 10 deletions
|
@ -19,20 +19,14 @@ import java.util.UUID;
|
|||
/**
|
||||
* @author noxx
|
||||
*/
|
||||
public class CombatManager {
|
||||
public enum CombatManager {
|
||||
|
||||
private static CombatManager combatManager;
|
||||
|
||||
instance;
|
||||
private final Map<UUID, Integer> combatAttackers = new HashMap<>();
|
||||
private final Map<UUID, Integer> combatBlockers = new HashMap<>();
|
||||
private int globalBlockersCount; // we need global counter as there are several combat groups
|
||||
|
||||
public static CombatManager getInstance() {
|
||||
if (combatManager == null) {
|
||||
combatManager = new CombatManager();
|
||||
}
|
||||
return combatManager;
|
||||
}
|
||||
|
||||
private Point parentPoint;
|
||||
|
||||
|
|
|
@ -860,9 +860,9 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
showRevealed(game);
|
||||
showLookedAt(game);
|
||||
if (!game.getCombat().isEmpty()) {
|
||||
CombatManager.getInstance().showCombat(game.getCombat(), gameId);
|
||||
CombatManager.instance.showCombat(game.getCombat(), gameId);
|
||||
} else {
|
||||
CombatManager.getInstance().hideCombat(gameId);
|
||||
CombatManager.instance.hideCombat(gameId);
|
||||
}
|
||||
|
||||
for (PlayerView player : game.getPlayers()) {
|
||||
|
|
Loading…
Reference in a new issue