Package vindinium.Board

Examples of vindinium.Board.Tile


    public Direction nearestAvailableMine(final Hero player, final Board board) {
        return new PathFinder(false, player, board).findNearest(new Predicate<PathFinder.State>() {
            @Override
            public boolean apply(PathFinder.State state) {
                Tile t = board.tileAt(state.hero.position);
                return t instanceof Mine && !((Mine) t).isOwnedBy(player);
            }
        });
    }
View Full Code Here


    public Direction nearestTavern(final Hero player, final Board board, boolean safe) {
        return new PathFinder(safe, player, board).findNearest(new Predicate<PathFinder.State>() {
            @Override
            public boolean apply(PathFinder.State state) {
                Tile t = board.tileAt(state.hero.position);
                return t == Tile.TAVERN;
            }
        });
    }
View Full Code Here

        return new PathFinder(false, player, gameState.game.board, PURSIT_TICKETS).findNearest(new Predicate<PathFinder.State>() {
            @Override
            public boolean apply(PathFinder.State state) {
                Game game = gameState.game;
                Board board = game.board;
                Tile t = board.tileAt(state.hero.position);
                if (t instanceof HeroTile) {
                    HeroTile heroTile = (HeroTile) t;
                    if (!heroTile.is(player)) {
                        Hero hero = game.findHero(heroTile.getHeroId());
                        if (hero.state.life < player.state.life - PathFinder.HP_LOSS_HERO_FIGHT && board.minesForHero(hero) > 0) {
View Full Code Here

        }
        if (state.dist > maxDist) {
            log("  Trying " + state + "  Impossible: too far");
            return false;
        }
        Tile tile = board.tileAt(state.hero.position);
        if (tile == Tile.WALL) {
            log("  Trying " + state + "  Impossible: it's a Wall");
            return false;
        }
        return true;
View Full Code Here

        }
        return true;
    }

    public boolean isFinalState(State state) {
        Tile tile = board.tileAt(state.hero.position);
        if (tile == Tile.AIR) {
            return false;
        }
        return true;
    }
View Full Code Here

    private int deltaHp(Position p, int currentHealth) {
        if (!p.isValid(board)) {
            return 0;
        }
        int delta = 0;
        Tile tile = board.tileAt(p);
        if (tile instanceof Mine) {
            Mine mine = (Mine) tile;
            delta += mine.isOwnedBy(hero) ? 0 : -HP_LOSS_MINE_FIGHT;
        } else if (tile == Tile.TAVERN) {
            delta += HP_WIN_TAVERN;
View Full Code Here

    private int deltaGold(Position p) {
        if (!p.isValid(board)) {
            return 0;
        }
        int delta = board.minesForHero(hero);
        Tile tile = board.tileAt(p);
        if (tile == Tile.TAVERN) {
            delta += -GOLD_LOSS_TAVERN;
        }
        return delta;
    }
View Full Code Here

    private int deltaMines(Position p) {
        if (!p.isValid(board)) {
            return 0;
        }
        Tile tile = board.tileAt(p);
        if (tile instanceof Mine) {
            return 1;
        }
        return 0;
    }
View Full Code Here

    // TODO this is inaccurate since we could be the attacker. Here we just assume they will attack us
    private int deltaHpFrom(Position p) {
        if (!p.isValid(board) || !safe) {
            return 0;
        }
        Tile tile = board.tileAt(p);
        if (tile instanceof HeroTile) {
            HeroTile heroTile = (HeroTile) tile;
            return heroTile.is(hero) ? 0 : -HP_LOSS_HERO_FIGHT;
        }
        return 0;
View Full Code Here

TOP

Related Classes of vindinium.Board.Tile

Copyright © 2018 www.massapicom. 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.