Examples of gameOver()


Examples of mage.game.Game.gameOver()

                    sim.applyEffects();
                }
                sim.fireEvent(GameEvent.getEvent(GameEvent.EventType.DECLARE_BLOCKERS_STEP_POST, sim.getActivePlayerId(), sim.getActivePlayerId()));
                Combat simCombat = sim.getCombat().copy();
                finishCombat(sim);
                if (sim.gameOver(null)) {
                    val = GameStateEvaluator.evaluate(playerId, sim);
                }
                else if (!counter) {
                    val = simulatePostCombatMain(sim, newNode, alpha, beta);
                }
View Full Code Here

Examples of mage.game.Game.gameOver()

            Thread.currentThread().interrupt();
            logger.debug(indent(node.depth) + "interrupted");
            return GameStateEvaluator.evaluate(playerId, game);
        }
        int val;
        if (node.depth > maxDepth || game.gameOver(null)) {
            logger.debug(indent(node.depth) + "simulating -- reached end state");
            val = GameStateEvaluator.evaluate(playerId, game);
        }
        else if (node.getChildren().size() > 0) {
            logger.debug(indent(node.depth) + "simulating -- somthing added children:" + node.getChildren().size());
View Full Code Here

Examples of mage.game.Game.gameOver()

                    game.getPlayers().resetPassed();
                    playNext(game, game.getActivePlayerId(), node);
                }
            }

            if (game.gameOver(null)) {
                val = GameStateEvaluator.evaluate(playerId, game);
            }
            else if (node.getChildren().size() > 0) {
                //declared attackers or blockers or triggered abilities
                logger.debug(indent(node.depth) + "simulating -- attack/block/trigger added children:" + node.getChildren().size());
View Full Code Here

Examples of mage.game.Game.gameOver()

                sim.applyEffects();
                if (checkForUselessAction(sim, node, action, currentPlayer.getId())) {
                    logger.debug(indent(node.depth) + "found useless action: " + action);
                    continue;
                }
                if (!sim.gameOver(null) && action.isUsesStack()) {
                    // only pass if the last action uses the stack
                    sim.getPlayer(currentPlayer.getId()).pass(game);
                    sim.getPlayerList().getNext();
                }
                SimulationNode newNode = new SimulationNode(node, sim, action, currentPlayer.getId());
View Full Code Here

Examples of mage.game.Game.gameOver()

        if (Thread.interrupted()) {
            Thread.currentThread().interrupt();
            logger.debug(indent(node.depth) + "interrupted");
            return GameStateEvaluator.evaluate(playerId, game);
        }
        if (node.depth > maxDepth || game.gameOver(null)) {
            logger.debug(indent(node.depth) + "simulating -- reached end state");
            val = GameStateEvaluator.evaluate(playerId, game);
        }
        else if (node.getChildren().size() > 0) {
            logger.debug(indent(node.depth) + "simulating -- somthing added children:" + node.getChildren().size());
View Full Code Here

Examples of mage.game.Game.gameOver()

                else {
                    stepFinished = true;
                }
            }

            if (game.gameOver(null)) {
                val = GameStateEvaluator.evaluate(playerId, game);
            }
            else if (stepFinished) {
                logger.debug(indent(node.depth) + "step finished");
                int testScore = GameStateEvaluator.evaluate(playerId, game);
View Full Code Here

Examples of mage.game.Game.gameOver()

            Thread.currentThread().interrupt();
            val = GameStateEvaluator2.evaluate(playerId, game);
            logger.trace("interrupted - " + val);
            return val;
        }
        if (depth <= 0 || SimulationNode2.nodeCount > maxNodes || game.gameOver(null)) {
            logger.trace("Add actions -- reached end state, node count=" + SimulationNode2.nodeCount + ", depth=" + depth);
            val = GameStateEvaluator2.evaluate(playerId, game);
            UUID currentPlayerId = node.getGame().getPlayerList().get();
            //logger.info("reached - " + val + ", playerId=" + playerId + ", node.pid="+currentPlayerId);
            return val;
View Full Code Here

Examples of mage.game.Game.gameOver()

                    game.getPlayers().resetPassed();
                    playNext(game, game.getActivePlayerId(), node);
                }
            }

            if (game.gameOver(null)) {
                val = GameStateEvaluator2.evaluate(playerId, game);
            } else if (node.getChildren().size() > 0) {
                //declared attackers or blockers or triggered abilities
                logger.debug("Add actions -- attack/block/trigger added children:" + node.getChildren().size());
                val = minimaxAB(node, depth - 1, alpha, beta);
View Full Code Here

Examples of mage.game.Game.gameOver()

                sim.applyEffects();
                if (checkForRepeatedAction(sim, node, action, currentPlayer.getId())) {
                    logger.debug("Sim Prio [" + depth + "] -- repeated action: " + action.toString());
                    continue;
                }
                if (!sim.gameOver(null) && action.isUsesStack()) {
                    // only pass if the last action uses the stack
                    sim.getPlayer(currentPlayer.getId()).pass(game);
                    sim.getPlayerList().getNext();
                }
                SimulationNode2 newNode = new SimulationNode2(node, sim, action, depth, currentPlayer.getId());
View Full Code Here

Examples of mage.game.Game.gameOver()

            Thread.currentThread().interrupt();
            logger.debug("interrupted");
            return GameStateEvaluator2.evaluate(playerId, game);
        }
        // Condition to stop deeper simulation
        if (depth <= 0 || SimulationNode2.nodeCount > maxNodes || game.gameOver(null)) {
            val = GameStateEvaluator2.evaluate(playerId, game);
            if (logger.isTraceEnabled()) {
                StringBuilder sb = new StringBuilder("Add Actions -- reached end state  <").append(val).append(">");
                SimulationNode2 logNode  = node;
                do {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.