Fixed Dwarven Axe, finally

This commit is contained in:
marcin.sciesinski
2019-08-30 12:49:56 -07:00
parent e1df113e31
commit 3d2e64045e
2 changed files with 9 additions and 3 deletions

View File

@@ -31,9 +31,11 @@ public class PlayerResolver {
final FilterableSource filterableSource = environment.getFilterFactory().generateFilter(filter);
return (playerId, game, self, effectResult, effect) -> {
final Filterable filterable = filterableSource.getFilterable(playerId, game, self, effectResult, effect);
final Collection<PhysicalCard> physicalCards = Filters.filterActive(game, filterable);
PhysicalCard card = physicalCards.iterator().next();
return card.getOwner();
// TODO SUPER messy
if (filterable instanceof PhysicalCard) {
return ((PhysicalCard) filterable).getOwner();
}
throw new RuntimeException("Unable to resolve card from filter");
};
}
throw new InvalidCardDefinitionException("Unable to resolve player resolver of type: " + type);

View File

@@ -28,12 +28,14 @@ public class IndividualCardAtTest extends AbstractAtTest {
PhysicalCardImpl gimli = new PhysicalCardImpl(100, "1_13", P1, _library.getLotroCardBlueprint("1_13"));
PhysicalCardImpl dwarvenAxe = new PhysicalCardImpl(101, "1_9", P1, _library.getLotroCardBlueprint("1_9"));
PhysicalCardImpl goblinRunner = new PhysicalCardImpl(102, "1_178", P2, _library.getLotroCardBlueprint("1_178"));
PhysicalCardImpl cardInDeck = new PhysicalCardImpl(103, "1_178", P2, _library.getLotroCardBlueprint("1_178"));
skipMulligans();
_game.getGameState().addCardToZone(_game, gimli, Zone.FREE_CHARACTERS);
_game.getGameState().attachCard(_game, dwarvenAxe, gimli);
_game.getGameState().addCardToZone(_game, goblinRunner, Zone.HAND);
_game.getGameState().putCardOnTopOfDeck(cardInDeck);
// End fellowship phase
assertEquals(Phase.FELLOWSHIP, _game.getGameState().getCurrentPhase());
@@ -79,6 +81,8 @@ public class IndividualCardAtTest extends AbstractAtTest {
assertEquals(Phase.REGROUP, _game.getGameState().getCurrentPhase());
assertEquals(Zone.DISCARD, goblinRunner.getZone());
assertEquals(Zone.DISCARD, cardInDeck.getZone());
}
@Test