Drafts: refactor to use same pack/pick number logic (#8039);

This commit is contained in:
Oleg Agafonov 2021-07-23 16:18:56 +04:00
parent 400acae0c1
commit 06ae494c5b
10 changed files with 41 additions and 52 deletions

View file

@ -17,18 +17,21 @@ public class BoosterDraft extends DraftImpl {
@Override
public void start() {
cardNum = 0;
while (!isAbort() && boosterNum < numberBoosters) {
cardNum = 1;
boosterNum = 1;
while (!isAbort() && boosterNum <= numberBoosters) {
openBooster();
cardNum = 0;
cardNum = 1;
fireUpdatePlayersEvent();
while (!isAbort() && pickCards()) {
if (boosterNum % 2 == 1) {
if ((boosterNum + 1) % 2 == 1) {
passLeft();
} else {
passRight();
}
fireUpdatePlayersEvent();
}
boosterNum++;
}
resetBufferedCards();
this.fireEndDraftEvent();