/** * Used to check the possible mana production to determine which spells * and/or abilities can be used. (player.getPlayable()). * * @param game * @return */ @Override public List<Mana> getNetMana(Game game) { if (netMana.isEmpty()) { ArrayList<Mana> dynamicNetMana = new ArrayList<>(); for (Effect effect : getEffects()) { if (effect instanceof ManaEffect) { List<Mana> effectNetMana = ((ManaEffect) effect).getNetMana(game, this); if (effectNetMana != null) { dynamicNetMana.addAll(effectNetMana); } } } return dynamicNetMana; } ArrayList<Mana> netManaCopy = new ArrayList<>(); for (Mana mana : netMana) { netManaCopy.add(mana.copy()); } return netManaCopy; }