Some first fixes.

This commit is contained in:
marcins78@gmail.com
2011-09-05 19:48:51 +00:00
parent 70e190ea02
commit 3f7a8a48c8
5 changed files with 11 additions and 10 deletions

View File

@@ -31,7 +31,8 @@ public class Card1_048 extends AbstractCompanion {
@Override @Override
public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self) { public boolean checkPlayRequirements(String playerId, LotroGame game, PhysicalCard self) {
return Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.ELF)); return super.checkPlayRequirements(playerId, game, self)
&& Filters.canSpot(game.getGameState(), game.getModifiersQuerying(), Filters.keyword(Keyword.ELF));
} }
@Override @Override

View File

@@ -128,8 +128,8 @@ public class ModifiersLogic implements ModifiersEnvironment, ModifiersQuerying {
} }
@Override @Override
public List<Modifier> getModifiersAffecting(GameState gameState, PhysicalCard card) { public Collection<Modifier> getModifiersAffecting(GameState gameState, PhysicalCard card) {
List<Modifier> result = new LinkedList<Modifier>(); Set<Modifier> result = new HashSet<Modifier>();
for (List<Modifier> modifiers : _modifiers.values()) { for (List<Modifier> modifiers : _modifiers.values()) {
for (Modifier modifier : modifiers) { for (Modifier modifier : modifiers) {
if (affectsCardWithSkipSet(gameState, card, modifier)) if (affectsCardWithSkipSet(gameState, card, modifier))

View File

@@ -7,10 +7,11 @@ import com.gempukku.lotro.game.PhysicalCard;
import com.gempukku.lotro.game.state.GameState; import com.gempukku.lotro.game.state.GameState;
import com.gempukku.lotro.logic.timing.Action; import com.gempukku.lotro.logic.timing.Action;
import java.util.Collection;
import java.util.List; import java.util.List;
public interface ModifiersQuerying { public interface ModifiersQuerying {
public List<Modifier> getModifiersAffecting(GameState gameState, PhysicalCard card); public Collection<Modifier> getModifiersAffecting(GameState gameState, PhysicalCard card);
public boolean hasKeyword(GameState gameState, PhysicalCard physicalCard, Keyword keyword); public boolean hasKeyword(GameState gameState, PhysicalCard physicalCard, Keyword keyword);

View File

@@ -43,7 +43,9 @@ public class PlayerPlaysStartingFellowshipGameProcess implements GameProcess {
new Filter() { new Filter() {
@Override @Override
public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) { public boolean accepts(GameState gameState, ModifiersQuerying modifiersQuerying, PhysicalCard physicalCard) {
return physicalCard.getBlueprint().checkPlayRequirements(playerId, _game, physicalCard); int twilightCost = modifiersQuerying.getTwilightCost(gameState, physicalCard);
return gameState.getTwilightPool() + twilightCost <= 4
&& physicalCard.getBlueprint().checkPlayRequirements(playerId, _game, physicalCard);
} }
}); });
} }

View File

@@ -11,10 +11,7 @@ import com.gempukku.lotro.logic.modifiers.Modifier;
import com.gempukku.lotro.logic.timing.DefaultLotroGame; import com.gempukku.lotro.logic.timing.DefaultLotroGame;
import com.gempukku.lotro.logic.vo.LotroDeck; import com.gempukku.lotro.logic.vo.LotroDeck;
import java.util.HashMap; import java.util.*;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
public class LotroGameMediator { public class LotroGameMediator {
private Map<String, GatheringParticipantCommunicationChannel> _communicationChannels = new HashMap<String, GatheringParticipantCommunicationChannel>(); private Map<String, GatheringParticipantCommunicationChannel> _communicationChannels = new HashMap<String, GatheringParticipantCommunicationChannel>();
@@ -46,7 +43,7 @@ public class LotroGameMediator {
return null; return null;
sb.append("<b>Affecting card:</b>"); sb.append("<b>Affecting card:</b>");
List<Modifier> modifiers = _lotroGame.getModifiersQuerying().getModifiersAffecting(_lotroGame.getGameState(), card); Collection<Modifier> modifiers = _lotroGame.getModifiersQuerying().getModifiersAffecting(_lotroGame.getGameState(), card);
for (Modifier modifier : modifiers) { for (Modifier modifier : modifiers) {
PhysicalCard source = modifier.getSource(); PhysicalCard source = modifier.getSource();
if (source != null) if (source != null)