megamek.common
Class CriticalSlot

java.lang.Object
  extended by megamek.common.CriticalSlot
All Implemented Interfaces:
java.io.Serializable

public class CriticalSlot
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
static int TYPE_EQUIPMENT
           
static int TYPE_SYSTEM
           
 
Constructor Summary
CriticalSlot(int type, int index)
           
CriticalSlot(int type, int index, boolean hittable, boolean armored, Mounted mount)
           
CriticalSlot(int type, int index, boolean hittable, Mounted mount)
           
CriticalSlot(int type, Mounted mount)
           
CriticalSlot(int type, Mounted mount, boolean hittable)
           
 
Method Summary
 boolean equals(java.lang.Object object)
          Two CriticalSlots are equal if their type and index are equal
 int getIndex()
           
 Mounted getMount()
           
 int getType()
           
 boolean isArmored()
           
 boolean isBreached()
           
 boolean isDamaged()
          Has this slot been damaged?
 boolean isDestroyed()
           
 boolean isEverHittable()
          Was this critical slot ever hittable?
 boolean isHit()
           
 boolean isHittable()
          Can this slot be hit by a critical hit roll?
 boolean isMissing()
           
 boolean isRepairable()
           
 boolean isRepairing()
          is the slot being repaired?
 void setArmored(boolean armored)
           
 void setBreached(boolean breached)
           
 void setDestroyed(boolean destroyed)
          Set this Mounted's destroyed status NOTE: only set this if this Mounted cannot be used in the current phase anymore.
 void setHit(boolean hit)
          set that this CriticalSlot was or was not hit with a crit this phase Note: stuff that was hit in a phase can still be used in that phase, if that's not desired, use setDestroyed instead
 void setIndex(int i)
           
 void setMissing(boolean missing)
           
 void setMount(Mounted mount)
           
 void setRepairable(boolean repair)
           
 void setRepairing(boolean repairing)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_SYSTEM

public static final int TYPE_SYSTEM
See Also:
Constant Field Values

TYPE_EQUIPMENT

public static final int TYPE_EQUIPMENT
See Also:
Constant Field Values
Constructor Detail

CriticalSlot

public CriticalSlot(int type,
                    int index)

CriticalSlot

public CriticalSlot(int type,
                    int index,
                    boolean hittable,
                    Mounted mount)

CriticalSlot

public CriticalSlot(int type,
                    int index,
                    boolean hittable,
                    boolean armored,
                    Mounted mount)

CriticalSlot

public CriticalSlot(int type,
                    Mounted mount)

CriticalSlot

public CriticalSlot(int type,
                    Mounted mount,
                    boolean hittable)
Method Detail

getType

public int getType()

getIndex

public int getIndex()

setIndex

public void setIndex(int i)

isHit

public boolean isHit()

setHit

public void setHit(boolean hit)
set that this CriticalSlot was or was not hit with a crit this phase Note: stuff that was hit in a phase can still be used in that phase, if that's not desired, use setDestroyed instead

Parameters:
hit -
See Also:
setDestroyed(boolean)

isDestroyed

public boolean isDestroyed()

setDestroyed

public void setDestroyed(boolean destroyed)
Set this Mounted's destroyed status NOTE: only set this if this Mounted cannot be used in the current phase anymore. If it still can, use setHit instead

Parameters:
destroyed -
See Also:
setHit(boolean)

isMissing

public boolean isMissing()

setMissing

public void setMissing(boolean missing)

isBreached

public boolean isBreached()

setBreached

public void setBreached(boolean breached)

isDamaged

public boolean isDamaged()
Has this slot been damaged?


isHittable

public boolean isHittable()
Can this slot be hit by a critical hit roll?


isEverHittable

public boolean isEverHittable()
Was this critical slot ever hittable?


isRepairing

public boolean isRepairing()
is the slot being repaired?


setRepairing

public void setRepairing(boolean repairing)

equals

public boolean equals(java.lang.Object object)
Two CriticalSlots are equal if their type and index are equal

Overrides:
equals in class java.lang.Object

setMount

public void setMount(Mounted mount)
Parameters:
mount - the mount to set

getMount

public Mounted getMount()
Returns:
the mount

setArmored

public void setArmored(boolean armored)

isArmored

public boolean isArmored()

setRepairable

public void setRepairable(boolean repair)

isRepairable

public boolean isRepairable()