Fixing bugs after moving responsibilities. That's more like it!
This commit is contained in:
@@ -33,7 +33,7 @@ public class Card4_208 extends AbstractOldEvent {
|
||||
new ChooseActiveCardEffect(self, playerId, "Choose an ISENGARD tracker", Filters.culture(Culture.ISENGARD), Filters.keyword(Keyword.TRACKER)) {
|
||||
@Override
|
||||
protected void cardSelected(LotroGame game, PhysicalCard card) {
|
||||
int bonus = 2 * Filters.countSpottable(game.getGameState(), game.getModifiersQuerying(), Filters.attachedTo(Filters.inSkirmishAgainst(card)));
|
||||
int bonus = 2 * Filters.countActive(game.getGameState(), game.getModifiersQuerying(), Filters.attachedTo(Filters.inSkirmishAgainst(card)));
|
||||
action.insertEffect(
|
||||
new AddUntilEndOfPhaseModifierEffect(
|
||||
new StrengthModifier(self, Filters.sameCard(card), bonus), Phase.SKIRMISH));
|
||||
|
||||
@@ -71,6 +71,9 @@ public class GameState {
|
||||
|
||||
for (String playerId : playerOrder.getAllPlayers())
|
||||
_playerThreats.put(playerId, 0);
|
||||
|
||||
for (GameStateListener listener : getAllGameStateListeners())
|
||||
listener.setPlayerOrder(playerOrder.getAllPlayers());
|
||||
}
|
||||
|
||||
public void setInitiativeSide(Side initiativeSide) {
|
||||
@@ -122,7 +125,7 @@ public class GameState {
|
||||
sendStateToPlayer(playerId, gameStateListener, gameStats);
|
||||
}
|
||||
|
||||
public void removeGameStateListener(String playerId, GameStateListener gameStateListener) {
|
||||
public void removeGameStateListener(GameStateListener gameStateListener) {
|
||||
_gameStateListeners.remove(gameStateListener);
|
||||
}
|
||||
|
||||
@@ -292,9 +295,6 @@ public class GameState {
|
||||
throw new RuntimeException("Card was not found in the expected zone");
|
||||
}
|
||||
|
||||
for (GameStateListener listener : getAllGameStateListeners())
|
||||
listener.cardsRemoved(playerPerforming, cards);
|
||||
|
||||
for (PhysicalCard card : cards) {
|
||||
Zone zone = card.getZone();
|
||||
|
||||
@@ -324,12 +324,19 @@ public class GameState {
|
||||
removeFromSkirmish(card);
|
||||
|
||||
removeAllTokens(card);
|
||||
}
|
||||
|
||||
for (GameStateListener listener : getAllGameStateListeners())
|
||||
listener.cardsRemoved(playerPerforming, cards);
|
||||
|
||||
for (PhysicalCard card : cards) {
|
||||
((PhysicalCardImpl) card).setZone(null);
|
||||
}
|
||||
}
|
||||
|
||||
private Set<PhysicalCard> getValue(Map<GameStateListener, Set<PhysicalCard>> map, GameStateListener listener) {
|
||||
private Set<PhysicalCard> getValue
|
||||
(Map<GameStateListener, Set<PhysicalCard>> map, GameStateListener
|
||||
listener) {
|
||||
Set<PhysicalCard> result = map.get(listener);
|
||||
if (result == null) {
|
||||
result = new HashSet<PhysicalCard>();
|
||||
|
||||
@@ -4,12 +4,11 @@ import com.gempukku.lotro.common.Phase;
|
||||
import com.gempukku.lotro.common.Token;
|
||||
import com.gempukku.lotro.communication.GameStateListener;
|
||||
import com.gempukku.lotro.game.PhysicalCard;
|
||||
import static com.gempukku.lotro.game.state.GameEvent.Type.*;
|
||||
import com.gempukku.lotro.logic.timing.GameStats;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static com.gempukku.lotro.game.state.GameEvent.Type.*;
|
||||
|
||||
public class GatheringParticipantCommunicationChannel implements GameStateListener {
|
||||
private List<GameEvent> _events = new LinkedList<GameEvent>();
|
||||
private String _self;
|
||||
@@ -88,8 +87,8 @@ public class GatheringParticipantCommunicationChannel implements GameStateListen
|
||||
if (card.getZone().isPublic() || (card.getZone().isVisibleByOwner() && card.getOwner().equals(_self)))
|
||||
removedCardsVisibleByPlayer.add(card);
|
||||
}
|
||||
|
||||
_events.add(new GameEvent(RCFP).otherCardIds(getCardIds(removedCardsVisibleByPlayer)).participantId(playerPerforming));
|
||||
if (removedCardsVisibleByPlayer.size() > 0)
|
||||
_events.add(new GameEvent(RCFP).otherCardIds(getCardIds(removedCardsVisibleByPlayer)).participantId(playerPerforming));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -183,7 +183,7 @@ public class DefaultLotroGame implements LotroGame {
|
||||
_gameState.addGameStateListener(playerId, gameStateListener, _turnProcedure.getGameStats());
|
||||
}
|
||||
|
||||
public void removeGameStateListener(String playerId, GameStateListener gameStateListener) {
|
||||
_gameState.removeGameStateListener(playerId, gameStateListener);
|
||||
public void removeGameStateListener(GameStateListener gameStateListener) {
|
||||
_gameState.removeGameStateListener(gameStateListener);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ public class LotroGameMediator {
|
||||
// User can always reconnect and establish a new channel
|
||||
GatheringParticipantCommunicationChannel channel = playerChannels.getValue();
|
||||
if (currentTime > channel.getLastConsumed().getTime() + _channelInactivityTimeoutPeriod) {
|
||||
_lotroGame.removeGameStateListener(playerId, channel);
|
||||
_lotroGame.removeGameStateListener(channel);
|
||||
_communicationChannels.remove(playerId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user