diff --git a/src/main/java/controls/StepScheduler.java b/src/main/java/controls/StepScheduler.java index 2800ffc..bd541c5 100644 --- a/src/main/java/controls/StepScheduler.java +++ b/src/main/java/controls/StepScheduler.java @@ -11,6 +11,7 @@ Algo algo; int turnCount=0; boolean isATurn; + boolean isSucceedLatestAttack; public StepScheduler(){ algo = new Algo(); isATurn=true; @@ -21,15 +22,18 @@ if(isATurn){ if(isDeckLess()){ algo.inputSelectA(guess, attacker, target); - + isSucceedLatestAttack = algo.getSucceedSelectA().getKey(); }else{ algo.inputDrawA(guess, target); + isSucceedLatestAttack = algo.getSucceedDrawA().getKey(); } }else { if(isDeckLess()){ algo.inputSelectB(guess, attacker, target); + isSucceedLatestAttack = algo.getSucceedSelectB().getKey(); }else{ algo.inputDrawB(guess, target); + isSucceedLatestAttack = algo.getSucceedDrawB().getKey(); } } turnCount++; @@ -55,19 +59,7 @@ return algo.getDeck().size()==0; } public boolean isSucceedLatestAttack(){ - if(isATurn){ - if(isDeckLess()){ - return algo.getSucceedSelectA().getKey(); - }else{ - return algo.getSucceedDrawA().getKey(); - } - }else { - if(isDeckLess()){ - return algo.getSucceedSelectB().getKey(); - }else{ - return algo.getSucceedDrawB().getKey(); - } - } + return isSucceedLatestAttack; } public boolean getIsATurn(){ return isATurn;