mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 04:12:14 -08:00
program towards Interface rather than implementations
This commit is contained in:
parent
b04c436801
commit
ae7919cd07
100 changed files with 218 additions and 209 deletions
|
|
@ -2973,7 +2973,7 @@ public class TestPlayer implements Player {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean flipCoin(Ability source, Game game, boolean winnable, ArrayList<UUID> appliedEffects) {
|
||||
public boolean flipCoin(Ability source, Game game, boolean winnable, List<UUID> appliedEffects) {
|
||||
return computerPlayer.flipCoin(source, game, true, appliedEffects);
|
||||
}
|
||||
|
||||
|
|
@ -2983,7 +2983,7 @@ public class TestPlayer implements Player {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int rollDice(Game game, ArrayList<UUID> appliedEffects, int numSides) {
|
||||
public int rollDice(Game game, List<UUID> appliedEffects, int numSides) {
|
||||
return computerPlayer.rollDice(game, appliedEffects, numSides);
|
||||
}
|
||||
|
||||
|
|
@ -3604,12 +3604,12 @@ public class TestPlayer implements Player {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PlanarDieRoll rollPlanarDie(Game game, ArrayList<UUID> appliedEffects) {
|
||||
public PlanarDieRoll rollPlanarDie(Game game, List<UUID> appliedEffects) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlanarDieRoll rollPlanarDie(Game game, ArrayList<UUID> appliedEffects, int numberChaosSides, int numberPlanarSides) {
|
||||
public PlanarDieRoll rollPlanarDie(Game game, List<UUID> appliedEffects, int numberChaosSides, int numberPlanarSides) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -642,7 +642,7 @@ public class PlayerStub implements Player {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean flipCoin(Ability source, Game game, boolean winnable, ArrayList<UUID> appliedEffects) {
|
||||
public boolean flipCoin(Ability source, Game game, boolean winnable, List<UUID> appliedEffects) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -652,7 +652,7 @@ public class PlayerStub implements Player {
|
|||
}
|
||||
|
||||
@Override
|
||||
public int rollDice(Game game, ArrayList<UUID> appliedEffects, int numSides) {
|
||||
public int rollDice(Game game, List<UUID> appliedEffects, int numSides) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
@ -1322,12 +1322,12 @@ public class PlayerStub implements Player {
|
|||
}
|
||||
|
||||
@Override
|
||||
public PlanarDieRoll rollPlanarDie(Game game, ArrayList<UUID> appliedEffects) {
|
||||
public PlanarDieRoll rollPlanarDie(Game game, List<UUID> appliedEffects) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlanarDieRoll rollPlanarDie(Game game, ArrayList<UUID> appliedEffects, int numberChaosSides, int numberPlanarSides) {
|
||||
public PlanarDieRoll rollPlanarDie(Game game, List<UUID> appliedEffects, int numberChaosSides, int numberPlanarSides) {
|
||||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package org.mage.test.utils;
|
|||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
|
|
@ -188,7 +189,7 @@ public class ManaUtilTest extends CardTestPlayerBase {
|
|||
Card card = CardRepository.instance.findCard(landName).getCard();
|
||||
Assert.assertNotNull(card);
|
||||
|
||||
HashMap<UUID, ActivatedManaAbilityImpl> useableAbilities = getManaAbilities(card);
|
||||
Map<UUID, ActivatedManaAbilityImpl> useableAbilities = getManaAbilities(card);
|
||||
Assert.assertEquals(expected1, useableAbilities.size());
|
||||
|
||||
useableAbilities = ManaUtil.tryToAutoPay(unpaid, (LinkedHashMap<UUID, ActivatedManaAbilityImpl>) useableAbilities);
|
||||
|
|
@ -216,7 +217,7 @@ public class ManaUtilTest extends CardTestPlayerBase {
|
|||
Card card = CardRepository.instance.findCard(landName).getCard();
|
||||
Assert.assertNotNull(card);
|
||||
|
||||
HashMap<UUID, ActivatedManaAbilityImpl> useableAbilities = getManaAbilities(card);
|
||||
Map<UUID, ActivatedManaAbilityImpl> useableAbilities = getManaAbilities(card);
|
||||
Assert.assertEquals(expected1, useableAbilities.size());
|
||||
|
||||
useableAbilities = ManaUtil.tryToAutoPay(unpaid, (LinkedHashMap<UUID, ActivatedManaAbilityImpl>) useableAbilities);
|
||||
|
|
@ -251,8 +252,8 @@ public class ManaUtilTest extends CardTestPlayerBase {
|
|||
* @param card Card to extract mana abilities from.
|
||||
* @return
|
||||
*/
|
||||
private HashMap<UUID, ActivatedManaAbilityImpl> getManaAbilities(Card card) {
|
||||
HashMap<UUID, ActivatedManaAbilityImpl> useableAbilities = new LinkedHashMap<>();
|
||||
private Map<UUID, ActivatedManaAbilityImpl> getManaAbilities(Card card) {
|
||||
Map<UUID, ActivatedManaAbilityImpl> useableAbilities = new LinkedHashMap<>();
|
||||
for (Ability ability : card.getAbilities()) {
|
||||
if (ability instanceof ActivatedManaAbilityImpl) {
|
||||
ability.newId(); // we need to assign id manually as we are not in game
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue