megamek.common
Class Minefield

java.lang.Object
  extended by megamek.common.Minefield
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class Minefield
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

See Also:
Serialized Form

Field Summary
static int CLEAR_NUMBER_INFANTRY
           
static int CLEAR_NUMBER_INFANTRY_ACCIDENT
           
static int[] CLEAR_NUMBER_SWEEPER
           
static int[] CLEAR_NUMBER_SWEEPER_ACCIDENT
           
static int CLEAR_NUMBER_WEAPON
           
static java.lang.String IMAGE_FILE
           
static int MAX_DAMAGE
           
static int TO_HIT_SIDE
           
static int TO_HIT_TABLE
           
static int TRIGGER_NONE
           
static int TYPE_ACTIVE
           
static int TYPE_COMMAND_DETONATED
           
static int TYPE_CONVENTIONAL
           
static int TYPE_EMP
           
static int TYPE_INFERNO
           
static int TYPE_SIZE
           
static int TYPE_VIBRABOMB
           
 
Method Summary
 void checkReduction(int bonus, boolean direct)
          check for a reduction in density
 java.lang.Object clone()
           
static Minefield createMinefield(Coords coords, int playerId, int type, int density)
           
static Minefield createMinefield(Coords coords, int playerId, int type, int density, boolean sea, int depth)
           
static Minefield createMinefield(Coords coords, int playerId, int type, int density, int setting)
           
static Minefield createMinefield(Coords coords, int playerId, int type, int density, int setting, boolean sea, int depth)
           
 boolean equals(java.lang.Object object)
           
 Coords getCoords()
           
 int getDensity()
           
 int getDepth()
           
static java.lang.String getDisplayableName(int type)
           
 java.lang.String getName()
           
 int getPlayerId()
           
 int getSetting()
           
 int getTrigger()
          what do we need to roll to trigger this mine
 int getType()
           
 boolean hasDetonated()
           
 boolean isOneUse()
           
 boolean isSeaBased()
           
 void setDensity(int density)
           
 void setDetonated(boolean b)
           
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_CONVENTIONAL

public static final int TYPE_CONVENTIONAL
See Also:
Constant Field Values

TYPE_COMMAND_DETONATED

public static final int TYPE_COMMAND_DETONATED
See Also:
Constant Field Values

TYPE_VIBRABOMB

public static final int TYPE_VIBRABOMB
See Also:
Constant Field Values

TYPE_ACTIVE

public static final int TYPE_ACTIVE
See Also:
Constant Field Values

TYPE_EMP

public static final int TYPE_EMP
See Also:
Constant Field Values

TYPE_INFERNO

public static final int TYPE_INFERNO
See Also:
Constant Field Values

TRIGGER_NONE

public static final int TRIGGER_NONE
See Also:
Constant Field Values

CLEAR_NUMBER_WEAPON

public static final int CLEAR_NUMBER_WEAPON
See Also:
Constant Field Values

CLEAR_NUMBER_INFANTRY

public static final int CLEAR_NUMBER_INFANTRY
See Also:
Constant Field Values

CLEAR_NUMBER_INFANTRY_ACCIDENT

public static final int CLEAR_NUMBER_INFANTRY_ACCIDENT
See Also:
Constant Field Values

CLEAR_NUMBER_SWEEPER

public static final int[] CLEAR_NUMBER_SWEEPER

CLEAR_NUMBER_SWEEPER_ACCIDENT

public static final int[] CLEAR_NUMBER_SWEEPER_ACCIDENT

TO_HIT_SIDE

public static final int TO_HIT_SIDE
See Also:
Constant Field Values

TO_HIT_TABLE

public static final int TO_HIT_TABLE
See Also:
Constant Field Values

MAX_DAMAGE

public static final int MAX_DAMAGE
See Also:
Constant Field Values

IMAGE_FILE

public static final java.lang.String IMAGE_FILE
See Also:
Constant Field Values

TYPE_SIZE

public static int TYPE_SIZE
Method Detail

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)

getDisplayableName

public static java.lang.String getDisplayableName(int type)

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.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

Returns:

isSeaBased

public boolean isSeaBased()

isOneUse

public boolean isOneUse()

getSetting

public int getSetting()

getType

public int getType()

getDepth

public int getDepth()

getName

public java.lang.String getName()

getPlayerId

public int getPlayerId()

setDetonated

public void setDetonated(boolean b)

hasDetonated

public boolean hasDetonated()

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 explodin