mirror of
https://github.com/correl/mage.git
synced 2024-11-28 19:19:55 +00:00
Some tests fixes. Returned back checking for repeated action with the fix.
This commit is contained in:
parent
f4b87c4c28
commit
dc2ebdd16d
5 changed files with 6 additions and 5 deletions
Binary file not shown.
|
@ -486,8 +486,8 @@ public class ComputerPlayer6 extends ComputerPlayer<ComputerPlayer6> implements
|
||||||
Game sim = game.copy();
|
Game sim = game.copy();
|
||||||
if (sim.getPlayer(currentPlayer.getId()).activateAbility((ActivatedAbility) action.copy(), sim)) {
|
if (sim.getPlayer(currentPlayer.getId()).activateAbility((ActivatedAbility) action.copy(), sim)) {
|
||||||
sim.applyEffects();
|
sim.applyEffects();
|
||||||
//if (checkForRepeatedAction(sim, node, action, currentPlayer.getId()))
|
if (checkForRepeatedAction(sim, node, action, currentPlayer.getId()))
|
||||||
//continue;
|
continue;
|
||||||
if (!sim.isGameOver() && action.isUsesStack()) {
|
if (!sim.isGameOver() && action.isUsesStack()) {
|
||||||
// only pass if the last action uses the stack
|
// only pass if the last action uses the stack
|
||||||
sim.getPlayer(currentPlayer.getId()).pass();
|
sim.getPlayer(currentPlayer.getId()).pass();
|
||||||
|
@ -839,7 +839,7 @@ public class ComputerPlayer6 extends ComputerPlayer<ComputerPlayer6> implements
|
||||||
return sim;
|
return sim;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*private boolean checkForRepeatedAction(Game sim, SimulationNode2 node, Ability action, UUID playerId) {
|
private boolean checkForRepeatedAction(Game sim, SimulationNode2 node, Ability action, UUID playerId) {
|
||||||
if (action instanceof PassAbility)
|
if (action instanceof PassAbility)
|
||||||
return false;
|
return false;
|
||||||
int val = GameStateEvaluator2.evaluate(playerId, sim);
|
int val = GameStateEvaluator2.evaluate(playerId, sim);
|
||||||
|
@ -848,12 +848,12 @@ public class ComputerPlayer6 extends ComputerPlayer<ComputerPlayer6> implements
|
||||||
test = test.getParent();
|
test = test.getParent();
|
||||||
}
|
}
|
||||||
if (test != null && test.getAbilities() != null && test.getAbilities().size() == 1) {
|
if (test != null && test.getAbilities() != null && test.getAbilities().size() == 1) {
|
||||||
if (action.toString().equals(test.getAbilities().get(0).toString()) && GameStateEvaluator2.evaluate(playerId, sim) == val) {
|
if (action.toString().equals(test.getAbilities().get(0).toString()) && GameStateEvaluator2.evaluate(playerId, test.getGame()) == val) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
protected void getSuggestedActions() {
|
protected void getSuggestedActions() {
|
||||||
try {
|
try {
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -33,6 +33,7 @@ public class LevelUpAbilityTest extends CardTestBase {
|
||||||
System.out.println(counter.getKey() + " : " + counter.getValue().getName() + " : " + counter.getValue().getCount());
|
System.out.println(counter.getKey() + " : " + counter.getValue().getName() + " : " + counter.getValue().getCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Assert.assertNotNull(master.getCounters());
|
||||||
Assert.assertFalse(master.getCounters().isEmpty());
|
Assert.assertFalse(master.getCounters().isEmpty());
|
||||||
Assert.assertEquals(12, master.getCounters().getCount(CounterType.LEVEL));
|
Assert.assertEquals(12, master.getCounters().getCount(CounterType.LEVEL));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue