mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
[refactor] moved enums from Constants class
This commit is contained in:
parent
4d16535709
commit
0bb110be45
7372 changed files with 28700 additions and 27583 deletions
|
|
@ -34,8 +34,8 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import mage.Constants.RangeOfInfluence;
|
||||
import mage.Constants.TableState;
|
||||
import mage.constants.RangeOfInfluence;
|
||||
import mage.constants.TableState;
|
||||
import mage.MageException;
|
||||
import mage.cards.decks.Deck;
|
||||
import mage.cards.decks.DeckCardLists;
|
||||
|
|
|
|||
|
|
@ -33,10 +33,11 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import mage.Constants;
|
||||
|
||||
import mage.MageException;
|
||||
import mage.cards.decks.Deck;
|
||||
import mage.cards.decks.DeckCardLists;
|
||||
import mage.constants.TableState;
|
||||
import mage.game.GameException;
|
||||
import mage.game.Table;
|
||||
import mage.game.draft.Draft;
|
||||
|
|
@ -303,7 +304,7 @@ public class TableManager {
|
|||
Date now = new Date();
|
||||
List<UUID> toRemove = new ArrayList<UUID>();
|
||||
for (Table table : tables.values()) {
|
||||
if (!table.getState().equals(Constants.TableState.FINISHED)) {
|
||||
if (!table.getState().equals(TableState.FINISHED)) {
|
||||
// remove all tables created more than expire_time ago
|
||||
long diff = (now.getTime() - table.getCreateTime().getTime()) / EXPIRE_TIME_UNIT_VALUE;
|
||||
if (diff >= EXPIRE_TIME) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ package mage.server.challenge;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
|
||||
import mage.constants.Zone;
|
||||
import mage.game.match.Match;
|
||||
|
||||
/**
|
||||
|
|
@ -19,8 +20,8 @@ public class ChallengeManager {
|
|||
}
|
||||
|
||||
public void prepareChallenge(UUID playerId, Match match) {
|
||||
Map<Constants.Zone, String> commands = new HashMap<Constants.Zone, String>();
|
||||
commands.put(Constants.Zone.OUTSIDE, "life:3");
|
||||
Map<Zone, String> commands = new HashMap<Zone, String>();
|
||||
commands.put(Zone.OUTSIDE, "life:3");
|
||||
match.getGame().cheat(playerId, commands);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
package mage.server.game;
|
||||
|
||||
import mage.Constants.Zone;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageException;
|
||||
import mage.abilities.Ability;
|
||||
import mage.cards.Card;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import mage.Constants.TableState;
|
||||
import mage.constants.TableState;
|
||||
import mage.MageException;
|
||||
import mage.cards.decks.DeckCardLists;
|
||||
import mage.game.GameException;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import java.lang.reflect.Constructor;
|
|||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import mage.Constants.RangeOfInfluence;
|
||||
import mage.constants.RangeOfInfluence;
|
||||
import mage.players.Player;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
package mage.server.util;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
|
|
@ -70,15 +70,15 @@ public class SystemUtil {
|
|||
continue;
|
||||
}
|
||||
|
||||
Constants.Zone gameZone;
|
||||
Zone gameZone;
|
||||
if ("hand".equalsIgnoreCase(zone)) {
|
||||
gameZone = Constants.Zone.HAND;
|
||||
gameZone = Zone.HAND;
|
||||
} else if ("battlefield".equalsIgnoreCase(zone)) {
|
||||
gameZone = Constants.Zone.BATTLEFIELD;
|
||||
gameZone = Zone.BATTLEFIELD;
|
||||
} else if ("graveyard".equalsIgnoreCase(zone)) {
|
||||
gameZone = Constants.Zone.GRAVEYARD;
|
||||
gameZone = Zone.GRAVEYARD;
|
||||
} else if ("library".equalsIgnoreCase(zone)) {
|
||||
gameZone = Constants.Zone.LIBRARY;
|
||||
gameZone = Zone.LIBRARY;
|
||||
} else {
|
||||
continue; // go parse next line
|
||||
}
|
||||
|
|
@ -121,11 +121,11 @@ public class SystemUtil {
|
|||
* @param game
|
||||
* @param card Card to put to player's hand
|
||||
*/
|
||||
private static void swapWithAnyCard(Game game, Player player, Card card, Constants.Zone zone) {
|
||||
if (zone.equals(Constants.Zone.BATTLEFIELD)) {
|
||||
card.putOntoBattlefield(game, Constants.Zone.OUTSIDE, null, player.getId());
|
||||
} else if (zone.equals(Constants.Zone.LIBRARY)) {
|
||||
game.setZone(card.getId(), Constants.Zone.LIBRARY);
|
||||
private static void swapWithAnyCard(Game game, Player player, Card card, Zone zone) {
|
||||
if (zone.equals(Zone.BATTLEFIELD)) {
|
||||
card.putOntoBattlefield(game, Zone.OUTSIDE, null, player.getId());
|
||||
} else if (zone.equals(Zone.LIBRARY)) {
|
||||
game.setZone(card.getId(), Zone.LIBRARY);
|
||||
player.getLibrary().putOnTop(card, game);
|
||||
} else {
|
||||
card.moveToZone(zone, null, game, false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue