Playing site trigger added.

This commit is contained in:
marcins78@gmail.com
2011-08-29 16:51:45 +00:00
parent 0864089989
commit 83e787c822

View File

@@ -8,6 +8,7 @@ import com.gempukku.lotro.game.state.GameState;
import com.gempukku.lotro.game.state.LotroGame; import com.gempukku.lotro.game.state.LotroGame;
import com.gempukku.lotro.logic.timing.processes.GameProcess; import com.gempukku.lotro.logic.timing.processes.GameProcess;
import com.gempukku.lotro.logic.timing.processes.turn.general.SimpleTriggeringGameProcess; import com.gempukku.lotro.logic.timing.processes.turn.general.SimpleTriggeringGameProcess;
import com.gempukku.lotro.logic.timing.results.PlayCardResult;
import com.gempukku.lotro.logic.timing.results.WhenMoveFromResult; import com.gempukku.lotro.logic.timing.results.WhenMoveFromResult;
import com.gempukku.lotro.logic.timing.results.WhenMoveToResult; import com.gempukku.lotro.logic.timing.results.WhenMoveToResult;
import com.gempukku.lotro.logic.timing.results.WhenMovesResult; import com.gempukku.lotro.logic.timing.results.WhenMovesResult;
@@ -16,6 +17,8 @@ public class PlayerPlaysNextSiteIfNotThereGameProcess implements GameProcess {
private LotroGame _game; private LotroGame _game;
private GameProcess _afterMoveGameProcess; private GameProcess _afterMoveGameProcess;
private GameProcess _nextProcess;
public PlayerPlaysNextSiteIfNotThereGameProcess(LotroGame game, GameProcess afterMoveGameProcess) { public PlayerPlaysNextSiteIfNotThereGameProcess(LotroGame game, GameProcess afterMoveGameProcess) {
_game = game; _game = game;
_afterMoveGameProcess = afterMoveGameProcess; _afterMoveGameProcess = afterMoveGameProcess;
@@ -42,15 +45,28 @@ public class PlayerPlaysNextSiteIfNotThereGameProcess implements GameProcess {
gameState.removeCardFromZone(nextSite); gameState.removeCardFromZone(nextSite);
gameState.addCardToZone(nextSite, Zone.ADVENTURE_PATH); gameState.addCardToZone(nextSite, Zone.ADVENTURE_PATH);
gameState.startAffecting(nextSite, _game.getModifiersEnvironment()); gameState.startAffecting(nextSite, _game.getModifiersEnvironment());
_nextProcess =
new SimpleTriggeringGameProcess(_game, new PlayCardResult(nextSite), "Played next site",
new SimpleTriggeringGameProcess(_game, new WhenMoveFromResult(), "Fellowship moved from",
new SimpleTriggeringGameProcess(_game, new WhenMovesResult(), "Fellowship moves",
new MovePlayerTokenToNextSiteGameProcess(_game,
new SimpleTriggeringGameProcess(_game, new WhenMoveToResult(), "Fellowship moved to",
_afterMoveGameProcess)))));
} else {
_nextProcess =
new SimpleTriggeringGameProcess(_game, new WhenMoveFromResult(), "Fellowship moved from",
new SimpleTriggeringGameProcess(_game, new WhenMovesResult(), "Fellowship moves",
new MovePlayerTokenToNextSiteGameProcess(_game,
new SimpleTriggeringGameProcess(_game, new WhenMoveToResult(), "Fellowship moved to",
_afterMoveGameProcess))));
} }
} }
@Override @Override
public GameProcess getNextProcess() { public GameProcess getNextProcess() {
return new SimpleTriggeringGameProcess(_game, new WhenMoveFromResult(), "Fellowship moved from", return _nextProcess;
new SimpleTriggeringGameProcess(_game, new WhenMovesResult(), "Fellowship moves",
new MovePlayerTokenToNextSiteGameProcess(_game,
new SimpleTriggeringGameProcess(_game, new WhenMoveToResult(), "Fellowship moved to",
_afterMoveGameProcess))));
} }
} }