megamek.common.verifier
Class TestEntity

java.lang.Object
  extended by megamek.common.verifier.TestEntity
All Implemented Interfaces:
TestEntityOption
Direct Known Subclasses:
TestMech, TestTank

public abstract class TestEntity
extends java.lang.Object
implements TestEntityOption


Field Summary
protected  Armor armor
           
static float CEIL_HALFTON
           
static float CEIL_QUARTERTON
           
static float CEIL_TENTHTON
           
static float CEIL_TON
           
protected  Engine engine
           
 java.lang.String fileString
           
protected  Structure structure
           
 
Fields inherited from interface megamek.common.verifier.TestEntityOption
CEIL_TARGCOMP_CRITS, FLOOR_TARGCOMP_CRITS, ROUND_TARGCOMP_CRITS
 
Constructor Summary
TestEntity(TestEntityOption options, Engine engine, Armor armor, Structure structure)
           
 
Method Summary
 int calcMiscCrits(MiscType mt)
           
 float calculateWeight()
           
protected static float ceil(float f, float type)
           
static float ceilMaxHalf(float f, float type)
           
abstract  boolean correctEntity(java.lang.StringBuffer buff)
           
abstract  boolean correctEntity(java.lang.StringBuffer buff, boolean ignoreAmmo)
           
 boolean correctWeight(java.lang.StringBuffer buff)
           
 boolean correctWeight(java.lang.StringBuffer buff, boolean showO, boolean showU)
           
 float getArmoredComponentWeight()
           
abstract  int getCountHeatSinks()
           
abstract  Entity getEntity()
           
 java.lang.String getLocationAbbr(int location)
           
 float getMaxOverweight()
           
 float getMinUnderweight()
           
abstract  java.lang.String getName()
           
 int getPrintSize()
           
 int getTargCompCrits()
           
 int getTotalOArmor()
           
 float getWeight()
           
 float getWeightAmmo()
           
 float getWeightArmor()
           
 float getWeightCarryingSpace()
           
 float getWeightCeilingArmor()
           
 float getWeightCeilingControls()
           
 float getWeightCeilingEngine()
           
 float getWeightCeilingGyro()
           
 float getWeightCeilingPowerAmp()
           
 float getWeightCeilingStructure()
           
 float getWeightCeilingTargComp()
           
 float getWeightCeilingTurret()
           
 float getWeightCeilingWeapons()
           
abstract  float getWeightControls()
           
 float getWeightEngine()
           
abstract  int getWeightHeatSinks()
           
abstract  float getWeightMisc()
           
 float getWeightMiscEquip()
           
abstract  float getWeightPowerAmp()
           
 float getWeightStructure()
           
 float getWeightWeapon()
           
abstract  boolean hasDoubleHeatSinks()
           
 boolean hasFailedEquipment(java.lang.StringBuffer buff)
           
 boolean hasIllegalEquipmentCombinations(java.lang.StringBuffer buff)
          Check if the unit has combinations of equipment which are not allowed in the construction rules.
 boolean hasIllegalTechLevels(java.lang.StringBuffer buff)
           
 boolean hasIllegalTechLevels(java.lang.StringBuffer buff, boolean ignoreAmmo)
           
 boolean ignoreFailedEquip(java.lang.String name)
           
 boolean isClan()
           
 boolean isClanArmor()
           
abstract  boolean isMech()
           
abstract  boolean isTank()
           
protected static java.lang.String makeWeightString(float weight)
           
 java.lang.StringBuffer printAmmo()
           
 java.lang.StringBuffer printAmmo(java.lang.StringBuffer buff)
           
 java.lang.StringBuffer printAmmo(java.lang.StringBuffer buff, int posLoc, int posWeight)
           
 java.lang.String printArmorLocation(int loc)
           
 java.lang.String printArmorPlacement()
           
abstract  java.lang.StringBuffer printEntity()
           
 java.lang.StringBuffer printFailedEquipment(java.lang.StringBuffer buff)
           
 java.lang.String printLocations()
           
 java.lang.StringBuffer printMiscEquip()
           
 java.lang.StringBuffer printMiscEquip(java.lang.StringBuffer buff)
           
 java.lang.StringBuffer printMiscEquip(java.lang.StringBuffer buff, int posLoc, int posWeight)
           
 java.lang.String printShortMovement()
           
 java.lang.String printTechLevel()
           
 java.lang.StringBuffer printWeapon()
           
 java.lang.StringBuffer printWeapon(java.lang.StringBuffer buff)
           
 java.lang.StringBuffer printWeapon(java.lang.StringBuffer buff, int posLoc, int posWeight)
           
 java.lang.String printWeightArmor()
           
 java.lang.String printWeightCalculation()
           
 java.lang.String printWeightCarryingSpace()
           
abstract  java.lang.String printWeightControls()
           
 java.lang.String printWeightEngine()
           
 java.lang.String printWeightHeatSinks()
           
abstract  java.lang.String printWeightMisc()
           
 java.lang.String printWeightStructure()
           
 boolean showCorrectArmor()
           
 boolean showCorrectCritical()
           
 boolean showFailedEquip()
           
 boolean showOverweightedEntity()
           
 boolean showUnderweightedEntity()
           
 boolean skip()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CEIL_TON

public static final float CEIL_TON
See Also:
Constant Field Values

CEIL_HALFTON

public static final float CEIL_HALFTON
See Also:
Constant Field Values

CEIL_QUARTERTON

public static final float CEIL_QUARTERTON
See Also:
Constant Field Values

CEIL_TENTHTON

public static final float CEIL_TENTHTON
See Also:
Constant Field Values

engine

protected Engine engine

armor

protected Armor armor

structure

protected Structure structure

fileString

public java.lang.String fileString
Constructor Detail

TestEntity

public TestEntity(TestEntityOption options,
                  Engine engine,
                  Armor armor,
                  Structure structure)
Method Detail

getEntity

public abstract Entity getEntity()

isTank

public abstract boolean isTank()

isMech

public abstract boolean isMech()

getWeightControls

public abstract float getWeightControls()

getWeightMisc

public abstract float getWeightMisc()

getWeightHeatSinks

public abstract int getWeightHeatSinks()

hasDoubleHeatSinks

public abstract boolean hasDoubleHeatSinks()

getCountHeatSinks

public abstract int getCountHeatSinks()

printWeightMisc

public abstract java.lang.String printWeightMisc()

printWeightControls

public abstract java.lang.String printWeightControls()

correctEntity

public abstract boolean correctEntity(java.lang.StringBuffer buff)

correctEntity

public abstract boolean correctEntity(java.lang.StringBuffer buff,
                                      boolean ignoreAmmo)

printEntity

public abstract java.lang.StringBuffer printEntity()

getName

public abstract java.lang.String getName()

isClan

public boolean isClan()

isClanArmor

public boolean isClanArmor()

getWeight

public float getWeight()

getTotalOArmor

public int getTotalOArmor()

getLocationAbbr

public java.lang.String getLocationAbbr(int location)

getWeightCeilingEngine

public float getWeightCeilingEngine()
Specified by:
getWeightCeilingEngine in interface TestEntityOption

getWeightCeilingStructure

public float getWeightCeilingStructure()
Specified by:
getWeightCeilingStructure in interface TestEntityOption

getWeightCeilingArmor

public float getWeightCeilingArmor()
Specified by:
getWeightCeilingArmor in interface TestEntityOption

getWeightCeilingControls

public float getWeightCeilingControls()
Specified by:
getWeightCeilingControls in interface TestEntityOption

getWeightCeilingWeapons

public float getWeightCeilingWeapons()
Specified by:
getWeightCeilingWeapons in interface TestEntityOption

getWeightCeilingTargComp

public float getWeightCeilingTargComp()
Specified by:
getWeightCeilingTargComp in interface TestEntityOption

getWeightCeilingGyro

public float getWeightCeilingGyro()
Specified by:
getWeightCeilingGyro in interface TestEntityOption

getWeightCeilingTurret

public float getWeightCeilingTurret()
Specified by:
getWeightCeilingTurret in interface TestEntityOption

getWeightCeilingPowerAmp

public float getWeightCeilingPowerAmp()
Specified by:
getWeightCeilingPowerAmp in interface TestEntityOption

getMaxOverweight

public float getMaxOverweight()
Specified by:
getMaxOverweight in interface TestEntityOption

showOverweightedEntity

public boolean showOverweightedEntity()
Specified by:
showOverweightedEntity in interface TestEntityOption

getMinUnderweight

public float getMinUnderweight()
Specified by:
getMinUnderweight in interface TestEntityOption

showUnderweightedEntity

public boolean showUnderweightedEntity()
Specified by:
showUnderweightedEntity in interface TestEntityOption

showCorrectArmor

public boolean showCorrectArmor()
Specified by:
showCorrectArmor in interface TestEntityOption

showCorrectCritical

public boolean showCorrectCritical()
Specified by:
showCorrectCritical in interface TestEntityOption

showFailedEquip

public boolean showFailedEquip()
Specified by:
showFailedEquip in interface TestEntityOption

ignoreFailedEquip

public boolean ignoreFailedEquip(java.lang.String name)
Specified by:
ignoreFailedEquip in interface TestEntityOption

skip

public boolean skip()
Specified by:
skip in interface TestEntityOption

getTargCompCrits

public int getTargCompCrits()
Specified by:
getTargCompCrits in interface TestEntityOption

getPrintSize

public int getPrintSize()
Specified by:
getPrintSize in interface TestEntityOption

ceil

protected static float ceil(float f,
                            float type)

ceilMaxHalf

public static float ceilMaxHalf(float f,
                                float type)

makeWeightString

protected static java.lang.String makeWeightString(float weight)

printShortMovement

public java.lang.String printShortMovement()

printWeightHeatSinks

public java.lang.String printWeightHeatSinks()

printWeightEngine

public java.lang.String printWeightEngine()

getWeightEngine

public float getWeightEngine()

printWeightStructure

public java.lang.String printWeightStructure()

getWeightStructure

public float getWeightStructure()

printWeightArmor

public java.lang.String printWeightArmor()

getWeightArmor

public float getWeightArmor()

getWeightMiscEquip

public float getWeightMiscEquip()

printMiscEquip

public java.lang.StringBuffer printMiscEquip()

printMiscEquip

public java.lang.StringBuffer printMiscEquip(java.lang.StringBuffer buff)

printMiscEquip

public java.lang.StringBuffer printMiscEquip(java.lang.StringBuffer buff,
                                             int posLoc,
                                             int posWeight)

getWeightWeapon

public float getWeightWeapon()

printWeapon

public java.lang.StringBuffer printWeapon()

printWeapon

public java.lang.StringBuffer printWeapon(java.lang.StringBuffer buff)

printWeapon

public java.lang.StringBuffer printWeapon(java.lang.StringBuffer buff,
                                          int posLoc,
                                          int posWeight)

getWeightAmmo

public float getWeightAmmo()

getWeightPowerAmp

public abstract float getWeightPowerAmp()

printAmmo

public java.lang.StringBuffer printAmmo()

printAmmo

public java.lang.StringBuffer printAmmo(java.lang.StringBuffer buff)

printAmmo

public java.lang.StringBuffer printAmmo(java.lang.StringBuffer buff,
                                        int posLoc,
                                        int posWeight)

printLocations

public java.lang.String printLocations()

calcMiscCrits

public int calcMiscCrits(MiscType mt)

calculateWeight

public float calculateWeight()

printWeightCalculation

public java.lang.String printWeightCalculation()

correctWeight

public boolean correctWeight(java.lang.StringBuffer buff)

correctWeight

public boolean correctWeight(java.lang.StringBuffer buff,
                             boolean showO,
                             boolean showU)

hasIllegalTechLevels

public boolean hasIllegalTechLevels(java.lang.StringBuffer buff)

hasIllegalTechLevels

public boolean hasIllegalTechLevels(java.lang.StringBuffer buff,
                                    boolean ignoreAmmo)

hasFailedEquipment

public boolean hasFailedEquipment(java.lang.StringBuffer buff)

hasIllegalEquipmentCombinations

public boolean hasIllegalEquipmentCombinations(java.lang.StringBuffer buff)
Check if the unit has combinations of equipment which are not allowed in the construction rules.

Parameters:
buff - diagnostics are appended to this
Returns:
true if the entity is illegal

printFailedEquipment

public java.lang.StringBuffer printFailedEquipment(java.lang.StringBuffer buff)

getWeightCarryingSpace

public float getWeightCarryingSpace()

printWeightCarryingSpace

public java.lang.String printWeightCarryingSpace()

printArmorLocation

public java.lang.String printArmorLocation(int loc)

printArmorPlacement

public java.lang.String printArmorPlacement()

printTechLevel

public java.lang.String printTechLevel()

getArmoredComponentWeight

public float getArmoredComponentWeight()