Commit 5c7c303c authored by Corentin Guillevic's avatar Corentin Guillevic
Browse files

Small refactoring ; Add some tests to upgrade the PowerApplicator cover

parent 350118ed
...@@ -758,7 +758,7 @@ public class Game implements GameInterface { ...@@ -758,7 +758,7 @@ public class Game implements GameInterface {
Phase toApplied = trackingCard.getPhaseToApply(); Phase toApplied = trackingCard.getPhaseToApply();
if(toApplied.equals(state)) { if(toApplied.equals(state)) {
creature.removeTrackingCardToApplied(trackingCard); creature.removeTrackingCardToApplied(trackingCard);
applyPlayerCard(creature.getInGameId(), trackingCard, this); applyPlayerCard(this, creature.getInGameId(), trackingCard);
trackingCardPioche.throwAway(trackingCard); trackingCardPioche.throwAway(trackingCard);
} }
else { else {
...@@ -852,13 +852,13 @@ public class Game implements GameInterface { ...@@ -852,13 +852,13 @@ public class Game implements GameInterface {
traque.addSurvivalCardToApplied(survivalCard); traque.addSurvivalCardToApplied(survivalCard);
} }
else{ else{
applyPlayerCard(traque.getInGameId(), survivalCard, this); applyPlayerCard(this, traque.getInGameId(), survivalCard);
traque.removeSurvivalCardToApplied(survivalCard); traque.removeSurvivalCardToApplied(survivalCard);
survivalCardPioche.throwAway(survivalCard); survivalCardPioche.throwAway(survivalCard);
} }
} }
else{ else{
applyPlayerCard(traque.getInGameId(), survivalCard, this); applyPlayerCard(this, traque.getInGameId(), survivalCard);
traque.playSurvivalCard(survivalCard); traque.playSurvivalCard(survivalCard);
survivalCardPioche.throwAway(survivalCard); survivalCardPioche.throwAway(survivalCard);
} }
...@@ -1066,7 +1066,7 @@ public class Game implements GameInterface { ...@@ -1066,7 +1066,7 @@ public class Game implements GameInterface {
for(Traque traque : traques) { for(Traque traque : traques) {
chosenPlaceCards = choosePlaceCardsToReveal(traque); chosenPlaceCards = choosePlaceCardsToReveal(traque);
for(PlaceCard placeCard : chosenPlaceCards) { for(PlaceCard placeCard : chosenPlaceCards) {
resolvePlace(traque.getInGameId(), placeCard, this); resolvePlace(this, traque.getInGameId(), placeCard);
} }
sendDescription(); sendDescription();
} }
......
...@@ -28,7 +28,7 @@ class DeckTest { ...@@ -28,7 +28,7 @@ class DeckTest {
@Test @Test
public void testGetMaxCards(){ public void testGetMaxCards(){
assertEquals(deck.getMaxCards(),6); assertEquals(6,deck.getMaxCards());
} }
@Test @Test
...@@ -42,7 +42,7 @@ class DeckTest { ...@@ -42,7 +42,7 @@ class DeckTest {
} }
@Test @Test
public void testclear(){ public void testClear(){
deck.clear(); deck.clear();
assertEquals(deck.getPlayedCards(),new ArrayList<>()); assertEquals(deck.getPlayedCards(),new ArrayList<>());
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment