Class Minefield

java.lang.Object
megamek.common.equipment.Minefield
All Implemented Interfaces:
Serializable, Cloneable

public class Minefield extends Object implements Serializable, Cloneable
See Also:
  • Field Details

  • Method Details

    • createMinefield

      public static Minefield createMinefield(Coords coords, int playerId, int type, int density)
    • createMinefield

      public static Minefield createMinefield(Coords coords, int playerId, int type, int density, boolean sea, int depth)
    • createMinefield

      public static Minefield createMinefield(Coords coords, int playerId, int type, int density, int setting)
    • createMinefield

      public static Minefield createMinefield(Coords coords, int playerId, int type, int density, int setting, boolean sea, int depth)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getDisplayableName

      public static String getDisplayableName(int type)
    • clone

      public Object clone()
      Overrides:
      clone in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • setDensity

      public void setDensity(int density)
    • getCoords

      public Coords getCoords()
    • getDensity

      public int getDensity()
    • getTrigger

      public int getTrigger()
      what do we need to roll to trigger this mine
    • isSeaBased

      @Deprecated(since="0.51.0", forRemoval=true) public boolean isSeaBased()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • isOneUse

      @Deprecated(since="0.51.0", forRemoval=true) public boolean isOneUse()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getSetting

      public int getSetting()
    • getType

      public int getType()
    • getDepth

      public int getDepth()
    • getName

      public String getName()
    • getPlayerId

      public int getPlayerId()
    • setDetonated

      public void setDetonated(boolean b)
    • hasDetonated

      public boolean hasDetonated()
    • setWeaponDelivered

      public void setWeaponDelivered(boolean b)
    • isWeaponDelivered

      public boolean isWeaponDelivered()
    • checkReduction

      public void checkReduction(int bonus, boolean direct)
      check for a reduction in density
      Parameters:
      bonus - - an int indicating the modifier to the target roll for reduction
      direct - - a boolean indicating whether this reduction was due to a direct explosion or a result of another minefield in the same hex exploding
    • getBAPDetectionTarget

      public int getBAPDetectionTarget()
      Gets the BAP detection target #