improve readability

master
melvin 2011-06-17 14:54:20 +08:00
parent 055e2a7b80
commit ac53056117
1 changed files with 8 additions and 9 deletions

View File

@ -6,19 +6,15 @@ public class MagicDefaultGameplay implements MagicGameplay {
private static final MagicGameplay INSTANCE=new MagicDefaultGameplay(); private static final MagicGameplay INSTANCE=new MagicDefaultGameplay();
private MagicDefaultGameplay() { private MagicDefaultGameplay() {}
}
@Override @Override
public MagicPhase getStartPhase(MagicGame game) { public MagicPhase getStartPhase(MagicGame game) {
return MagicUntapPhase.getInstance(); return MagicUntapPhase.getInstance();
} }
@Override @Override
public MagicPhase getNextPhase(final MagicGame game) { public MagicPhase getNextPhase(final MagicGame game) {
switch (game.getPhase().getType()) { switch (game.getPhase().getType()) {
case Untap: case Untap:
return MagicUpkeepPhase.getInstance(); return MagicUpkeepPhase.getInstance();
@ -27,11 +23,15 @@ public class MagicDefaultGameplay implements MagicGameplay {
case Draw: case Draw:
return MagicMainPhase.getFirstInstance(); return MagicMainPhase.getFirstInstance();
case FirstMain: case FirstMain:
return game.canSkip()?MagicDeclareAttackersPhase.getInstance():MagicBeginOfCombatPhase.getInstance(); return game.canSkip() ?
MagicDeclareAttackersPhase.getInstance() :
MagicBeginOfCombatPhase.getInstance();
case BeginOfCombat: case BeginOfCombat:
return MagicDeclareAttackersPhase.getInstance(); return MagicDeclareAttackersPhase.getInstance();
case DeclareAttackers: case DeclareAttackers:
return game.getTurnPlayer().getNrOfAttackers()>0?MagicDeclareBlockersPhase.getInstance():MagicEndOfCombatPhase.getInstance(); return game.getTurnPlayer().getNrOfAttackers() > 0 ?
MagicDeclareBlockersPhase.getInstance() :
MagicEndOfCombatPhase.getInstance();
case DeclareBlockers: case DeclareBlockers:
return MagicCombatDamagePhase.getInstance(); return MagicCombatDamagePhase.getInstance();
case CombatDamage: case CombatDamage:
@ -50,7 +50,6 @@ public class MagicDefaultGameplay implements MagicGameplay {
} }
public static MagicGameplay getInstance() { public static MagicGameplay getInstance() {
return INSTANCE; return INSTANCE;
} }
} }