Package megamek.common
Class CriticalSlot
java.lang.Object
megamek.common.CriticalSlot
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCriticalSlot(int type, int index) CriticalSlot(int type, int index, boolean hittable, boolean armored) CriticalSlot(Mounted<?> mount) -
Method Summary
Modifier and TypeMethodDescriptionbooleanTwo CriticalSlots are equal if their type, index and mount are equalintgetIndex()Mounted<?> getMount()Mounted<?> intgetType()inthashCode()voidbooleanbooleanbooleanbooleanHas this slot been damaged?booleanbooleanWas this critical slot ever hittable?booleanisHit()booleanCan this slot be hit by a critical hit roll?booleanbooleanbooleanbooleanis the slot being repaired?voidsetArmored(boolean armored) voidsetBreached(boolean breached) voidsetDestroyed(boolean destroyed) Set this Mounted's destroyed status NOTE: only set this if this Mounted cannot be used in the current phase anymore.voidsetHit(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 insteadvoidsetIndex(int i) voidsetMissing(boolean missing) voidvoidvoidsetRepairable(boolean repair) voidsetRepairing(boolean repairing) toString()
-
Field Details
-
TYPE_SYSTEM
public static final int TYPE_SYSTEM- See Also:
-
TYPE_EQUIPMENT
public static final int TYPE_EQUIPMENT- See Also:
-
-
Constructor Details
-
CriticalSlot
public CriticalSlot(int type, int index) -
CriticalSlot
public CriticalSlot(int type, int index, boolean hittable, boolean armored) -
CriticalSlot
-
-
Method Details
-
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- See Also:
-
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- See Also:
-
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
Two CriticalSlots are equal if their type, index and mount are equal -
hashCode
public int hashCode() -
setMount
- Parameters:
mount- the mount to set
-
getMount
- Returns:
- the mount
-
setMount2
- Parameters:
mount- the mount to set
-
getMount2
- Returns:
- the mount
-
setArmored
public void setArmored(boolean armored) -
hitArmored
public void hitArmored() -
isArmored
public boolean isArmored() -
isOriginalArmored
public boolean isOriginalArmored() -
setRepairable
public void setRepairable(boolean repair) -
isRepairable
public boolean isRepairable() -
toString
-
isArmorable
public boolean isArmorable()- Returns:
- True if this crit slot is eligible for being an armored component, TO:AUE p.95
-