Package megamek.common

Examples of megamek.common.Coords


        }
           
        // Cycle through all hexes, checking for the appropriate weather changes
        for (int currentXCoord = 0; currentXCoord < width; currentXCoord++ ) {
            for (int currentYCoord = 0; currentYCoord < height; currentYCoord++) {
                Coords currentCoords = new Coords(currentXCoord, currentYCoord);
                IHex currentHex = board.getHex(currentXCoord, currentYCoord);

                //check for fires and potentially put them out
                if (currentHex.containsTerrain(Terrains.FIRE)) {
                    //only standard fires get put out
View Full Code Here


        debugTime("resolve quicksand 1", true);

        for (int currentXCoord = 0; currentXCoord < width; currentXCoord++ ) {

            for (int currentYCoord = 0; currentYCoord < height; currentYCoord++) {
                Coords currentCoords = new Coords(currentXCoord, currentYCoord);
                IHex currentHex = board.getHex(currentXCoord, currentYCoord);

                //check for quicksand that has been around at least one turn
                if(currentHex.terrainLevel(Terrains.SWAMP) == 3) {
                    //sink any units that occupy this hex
View Full Code Here

        vPhaseReport.add(r);

        ITerrainFactory tf = Terrains.getTerrainFactory();
        for (Iterator<Coords> i = elevators[roll].positions.iterator(); i
                .hasNext();) {
            Coords c = i.next();
            IHex hex = server.getGame().getBoard().getHex(c);
            ITerrain terr = hex.getTerrain(Terrains.ELEVATOR);
            // Swap the elevator and hex elevations
            // Entity elevations are not adjusted. This makes sense for
            // everything except possibly
View Full Code Here

                    // add the elevator to each list it belongs in.
                    // exits are abused to hold which d6 roll(s) move this
                    // elevator
                    for (int z = 0; z < 6; z++) {
                        if ((exits & 1) == 1) {
                            elevators[z].positions.add(new Coords(x, y));
                        }
                        exits >>= 1;
                    }
                }
            }
View Full Code Here

     * Checks if a charge can hit the target, taking account of movement
     */
    public ToHitData toHit(IGame game, MovePath md) {
        final Entity ae = game.getEntity(getEntityId());
        final Targetable target = getTarget(game);
        Coords chargeSrc = ae.getPosition();
        int chargeEl = ae.getElevation();
        MoveStep chargeStep = null;

        // let's just check this
        if (!md.contains(MovePath.STEP_CHARGE)) {
View Full Code Here

            return;
        }

        em.move(entity, movePath, game.getBoard());

        Coords c = movePath.elementAt(0).getCoords();
        currentView.centerOnHex(c, game.getBoard().getHex(c));
    }
View Full Code Here

            w = gboard.getWidth();
            h = gboard.getHeight();

            for (int y = 0; y < h; y++) {
                for (int x = 0; x < w; x++) {
                    Coords c = new Coords(x, y);
                    BoardHexModel b = new BoardHexModel(game, c, gboard.getHex(c), tileManager, shared);
                    addChild(b);
                }
            }
View Full Code Here

        }
        isDeploying = true;
        IBoard gboard = game.getBoard();

        detach();
        Coords c = new Coords(0,0);
        for (c.y = 0; c.y < h; c.y++) {
            for (c.x = 0; c.x < w; c.x++) {
                if (!gboard.isLegalDeployment(c, deployer)) {
                    hexAt(c.x, c.y).darken();
                } else {
View Full Code Here

        return height;
    }

    public EntityModel(Entity entity, TileTextureManager tilesetManager, ViewTransform view, IGame game) {
        Coords c = entity.getPosition();
        IHex hex = game.getBoard().getHex(c);

        int elevation = entity.getElevation();
        int dir = entity.getFacing();
        if (dir == -1) dir = 0;
View Full Code Here

        hoverInfo.update();
        refreshDisplayables();
    }

    public void mousePressed(MouseEvent me) {
        Coords c = pickCoords(me);
        if (c == null) {
            return;
        }
        dragged = false;
View Full Code Here

TOP

Related Classes of megamek.common.Coords

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.