simplified isMain and getIndex

master
melvin 2011-06-16 20:49:14 +08:00
parent 976e66abb9
commit 6e860693bc
1 changed files with 16 additions and 24 deletions

View File

@ -2,43 +2,35 @@ package magic.model.phase;
public enum MagicPhaseType {
Untap("Untap",false,0),
Upkeep("Upkeep",false,1),
Draw("Draw",false,2),
FirstMain("First Main",true,3),
BeginOfCombat("Begin of Combat",false,4),
DeclareAttackers("Declare Attackers",false,5),
DeclareBlockers("Declare Blockers",false,6),
CombatDamage("Combat Damage",false,7),
EndOfCombat("End of Combat",false,8),
SecondMain("Second Main",true,9),
EndOfTurn("End of Turn",false,10),
Cleanup("Cleanup",false,11),
Untap("Untap"),
Upkeep("Upkeep"),
Draw("Draw"),
FirstMain("First Main"),
BeginOfCombat("Begin of Combat"),
DeclareAttackers("Declare Attackers"),
DeclareBlockers("Declare Blockers"),
CombatDamage("Combat Damage"),
EndOfCombat("End of Combat"),
SecondMain("Second Main"),
EndOfTurn("End of Turn"),
Cleanup("Cleanup"),
;
private final String name;
private final boolean main;
private final int index;
private MagicPhaseType(final String name,final boolean main,final int index) {
private MagicPhaseType(final String name) {
this.name=name;
this.main=main;
this.index=index;
}
public String getName() {
return name;
}
public boolean isMain() {
return main;
return this == FirstMain || this == SecondMain;
}
public int getIndex() {
return index;
return ordinal();
}
}
}