Examples of floor()


Examples of java.util.NavigableSet.floor()

        }

        keySet = navigableMap_startIncluded_endIncluded.navigableKeySet();
        keyArray = (String[]) keySet.toArray(new String[keySet.size()]);
        for (int i = 0, j = 100; i < keyArray.length; i++) {
            key = (String) keySet.floor(keyArray[i]);
            assertEquals(new Integer(i + j).toString(), key);
        }

        key = new Integer(2).toString();
        keySet = tm.headMap(key, true).navigableKeySet();
View Full Code Here

Examples of java.util.NavigableSet.floor()

        key = new Integer(2).toString();
        keySet = tm.headMap(key, true).navigableKeySet();
        Iterator iterator = keySet.iterator();
        iterator.next();
        assertEquals(new Integer(1).toString(), keySet.floor(iterator.next()));

        try {
            keySet.floor(null);
            fail("should throw NPE");
        } catch (NullPointerException e) {
View Full Code Here

Examples of java.util.NavigableSet.floor()

            // Expected
        }

        key = new Integer(0).toString();
        keySet = tm.headMap(key, true).navigableKeySet();
        assertEquals(key, keySet.floor(key));

        key = new Integer(0).toString();
        keySet = tm.headMap(key, false).navigableKeySet();
        assertNull(keySet.floor(key));
View Full Code Here

Examples of java.util.NavigableSet.floor()

        keySet = tm.headMap(key, true).navigableKeySet();
        assertEquals(key, keySet.floor(key));

        key = new Integer(0).toString();
        keySet = tm.headMap(key, false).navigableKeySet();
        assertNull(keySet.floor(key));

        key = new Integer(999).toString();
        keySet = tm.headMap(key, true).navigableKeySet();
        assertEquals(key, keySet.floor(key));
View Full Code Here

Examples of java.util.NavigableSet.floor()

        keySet = tm.headMap(key, false).navigableKeySet();
        assertNull(keySet.floor(key));

        key = new Integer(999).toString();
        keySet = tm.headMap(key, true).navigableKeySet();
        assertEquals(key, keySet.floor(key));

        key = new Integer(999).toString();
        keySet = tm.headMap(key, false).navigableKeySet();
        assertEquals(new Integer(998).toString(), keySet.floor(key));
    }
View Full Code Here

Examples of megamek.common.IHex.floor()

     * opposite direction as well.
     */
    private final boolean drawElevationLine(Coords src, int direction) {
        final IHex srcHex = game.getBoard().getHex(src);
        final IHex destHex = game.getBoard().getHexInDir(src, direction);
        return (destHex != null) && (srcHex.floor() != destHex.floor());
    }

    /**
     * Returns the absolute position of the upper-left hand corner of the hex
     * graphic
 
View Full Code Here

Examples of megamek.common.IHex.floor()

        // Now figure out the height to which that hex will provide shelter.
        // It's worth noting, this assumes that any building in the hex has
        // already survived the bomb blast. In the case where a building
        // won't survive the blast but hasn't actually taken the damage
        // yet, this will be wrong.
        int shelterLevel = shelteringHex.floor();
        if (shelteringHex.containsTerrain(Terrains.BUILDING)) {
            shelterLevel = shelteringHex.ceiling();
        }

        // Get the absolute height of the unit relative to level 0.
View Full Code Here

Examples of megamek.common.IHex.floor()

                // Then, remove ANY terrains here.
                // I mean ALL of them; they're all just gone.
                // No ruins, no water, no rough, no nothing.
                if (myHex.containsTerrain(Terrains.WATER)) {
                    myHex.setElevation(myHex.floor());
                }
                myHex.removeAllTerrains();
                myHex.clearExits();

                sendChangedHex(myHexCoords);
View Full Code Here

Examples of megamek.common.IHex.floor()

            addReport(r);
            tmpB.setCurrentCF(0, position);
        }
        IHex gzHex = game.getBoard().getHex(position);
        if (gzHex.containsTerrain(Terrains.WATER)) {
            gzHex.setElevation(gzHex.floor());
        }
        gzHex.removeAllTerrains();

        // Next, for whatever's left, do terrain effects
        // such as clearing, roughing, and boiling off water.
View Full Code Here

Examples of megamek.common.IHex.floor()

    private Vector<Report> doEntityFallsInto(Entity entity, Coords src, Coords dest, PilotingRollData roll, boolean causeAffa) {
        Vector<Report> vPhaseReport = new Vector<Report>();
        final IHex srcHex = game.getBoard().getHex(src);
        final IHex destHex = game.getBoard().getHex(dest);
        final int srcHeightAboveFloor = entity.getElevation() + srcHex.depth();
        final int fallElevation = Math.max(0, srcHex.floor() + srcHeightAboveFloor - (destHex.containsTerrain(Terrains.ICE) ? destHex.surface() : destHex.floor()));
        int direction;
        if (src.equals(dest)) {
            direction = Compute.d6() - 1;
        } else {
            direction = src.direction(dest);
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.