public boolean isMine() { if (dataFile.exists("blockversion")) { return true; } return false; }
public void checkManualBV(Entity e) throws EntityLoadingException { if (dataFile.exists("bv")) { int bv = dataFile.getDataAsInt("bv")[0]; if (bv != 0) { e.setUseManualBV(true); e.setManualBV(bv); } } }
if (dataFile.exists("capabilities")) { e.getFluff().setCapabilities(dataFile.getDataAsString("capabilities")[0]); if (dataFile.exists("overview")) { e.getFluff().setOverview(dataFile.getDataAsString("overview")[0]); if (dataFile.exists("deployment")) { e.getFluff().setDeployment(dataFile.getDataAsString("deployment")[0]); if (dataFile.exists("history")) { e.getFluff().setHistory(dataFile.getDataAsString("history")[0]); if (dataFile.exists("manufacturer")) { e.getFluff().setManufacturer(dataFile.getDataAsString("manufacturer")[0]); if (dataFile.exists("primaryFactory")) { e.getFluff().setPrimaryFactory(dataFile.getDataAsString("primaryFactory")[0]); if (dataFile.exists("systemManufacturers")) { for (String line : dataFile.getDataAsString("systemManufacturers")) { String[] fields = line.split(":"); if (dataFile.exists("systemModels")) { for (String line : dataFile.getDataAsString("systemModels")) { String[] fields = line.split(":"); if (dataFile.exists("imagepath")) { e.getFluff().setMMLImagePath( dataFile.getDataAsString("imagepath")[0]);
} else if (lowerName.endsWith(".blk")) { BuildingBlock bb = new BuildingBlock(is); if (bb.exists("UnitType")) { String sType = bb.getDataAsString("UnitType")[0]; if (sType.equals("Tank") || sType.equals("Naval")
if (!dataFile.exists("Name")) { throw new EntityLoadingException("Could not find name block."); if (dataFile.exists("Model") && (dataFile.getDataAsString("Model")[0] != null)) { e.setModel(dataFile.getDataAsString("Model")[0]); } else { checkManualBV(e); if (dataFile.exists("source")) { e.setSource(dataFile.getDataAsString("source")[0]); if (dataFile.exists("Turret")) { if (dataFile.getDataAsInt("Turret")[0] != 1) { e.setHasNoTurret(true);
if (!dataFile.exists("name")) { throw new EntityLoadingException("Could not find name block."); if (dataFile.exists("Model") && (dataFile.getDataAsString("Model")[0] != null)) { t.setModel(dataFile.getDataAsString("Model")[0]); } else { if (dataFile.exists("source")) { t.setSource(dataFile.getDataAsString("source")[0]); if (dataFile.exists("exoskeleton") && dataFile.getDataAsString("exoskeleton")[0].equalsIgnoreCase("true")) { t.setIsExoskeleton(true); if (!dataFile.exists("trooper count")) { throw new EntityLoadingException("Could not find trooper count block."); if (!dataFile.exists("weightclass")) { throw new EntityLoadingException("Could not find weightclass block."); if (!dataFile.exists("chassis")) { throw new EntityLoadingException("Could not find chassis block."); if (!dataFile.exists("motion_type")) { throw new EntityLoadingException("Could not find movement block."); if (!dataFile.exists("cruiseMP")) { throw new EntityLoadingException("Could not find cruiseMP block."); if (dataFile.exists("jumpingMP")) {
if (!dataFile.exists("Name")) { throw new EntityLoadingException("Could not find name block."); if (dataFile.exists("Model") && (dataFile.getDataAsString("Model")[0] != null)) { a.setModel(dataFile.getDataAsString("Model")[0]); if (dataFile.exists("source")) { a.setSource(dataFile.getDataAsString("source")[0]); if (dataFile.exists("originalBuildYear")) { a.setOriginalBuildYear(dataFile.getDataAsInt("originalBuildYear")[0]); if (!dataFile.exists("crew")) { throw new EntityLoadingException("Could not find crew block."); if (dataFile.exists("officers")) { a.setNOfficers(dataFile.getDataAsInt("officers")[0]); if (dataFile.exists("gunners")) { a.setNGunners(dataFile.getDataAsInt("gunners")[0]); if (dataFile.exists("passengers")) { a.setNPassenger(dataFile.getDataAsInt("passengers")[0]); if (dataFile.exists("battlearmor")) { a.setNBattleArmor(dataFile.getDataAsInt("battlearmor")[0]); if (dataFile.exists("marines")) {
if (!dataFile.exists("Name")) { throw new EntityLoadingException("Could not find name block."); if (dataFile.exists("Model") && (dataFile.getDataAsString("Model")[0] != null)) { a.setModel(dataFile.getDataAsString("Model")[0]); } else { if (dataFile.exists("source")) { a.setSource(dataFile.getDataAsString("source")[0]); if (dataFile.exists("originalBuildYear")) { a.setOriginalBuildYear(dataFile.getDataAsInt("originalBuildYear")[0]); if (!dataFile.exists("tonnage")) { throw new EntityLoadingException("Could not find tonnage block."); if (!dataFile.exists("crew")) { throw new EntityLoadingException("Could not find crew block."); if (dataFile.exists("officers")) { a.setNOfficers(dataFile.getDataAsInt("officers")[0]); if (dataFile.exists("gunners")) { a.setNGunners(dataFile.getDataAsInt("gunners")[0]); if (dataFile.exists("battlearmor")) { a.setNBattleArmor(dataFile.getDataAsInt("battlearmor")[0]); if (dataFile.exists("marines")) {
if (!dataFile.exists("Name")) { throw new EntityLoadingException("Could not find name block."); if (dataFile.exists("Model") && (dataFile.getDataAsString("Model")[0] != null)) { a.setModel(dataFile.getDataAsString("Model")[0]); } else { if (dataFile.exists("source")) { a.setSource(dataFile.getDataAsString("source")[0]); if (!dataFile.exists("tonnage")) { throw new EntityLoadingException("Could not find weight block."); if (!dataFile.exists("heatsinks")) { throw new EntityLoadingException("Could not find heatsinks block."); if (!dataFile.exists("sink_type")) { throw new EntityLoadingException("Could not find sink_type block."); if (!dataFile.exists("fuel")) { throw new EntityLoadingException("Could not find fuel block."); if (dataFile.exists("engine_type")) { engineCode = dataFile.getDataAsInt("engine_type")[0]; if (!dataFile.exists("SafeThrust")) { throw new EntityLoadingException("Could not find SafeThrust block."); if (dataFile.exists("armor_type")) {
if (!dataFile.exists("name")) { throw new EntityLoadingException("Could not find name block."); if (!dataFile.exists("model")) { throw new EntityLoadingException("Could not find model block."); if (dataFile.exists("source")) { t.setSource(dataFile.getDataAsString("source")[0]); if (!dataFile.exists("squad_size")) { throw new EntityLoadingException("Could not find squad size."); if (!dataFile.exists("squadn")) { throw new EntityLoadingException("Could not find number of squads."); if (dataFile.exists("InfantryArmor")) { t.setDamageDivisor(dataFile.getDataAsInt("InfantryArmor")[0]); if (!dataFile.exists("motion_type")) { throw new EntityLoadingException("Could not find movement block."); if (dataFile.exists("secondn")) { t.setSecondaryN(dataFile.getDataAsInt("secondn")[0]); if (!dataFile.exists("Primary")) { throw new EntityLoadingException("Could not find primary weapon."); if (dataFile.exists("Secondary")) { String secondName = dataFile.getDataAsString("Secondary")[0];
if (!dataFile.exists("name")) { throw new EntityLoadingException("Could not find name block."); if (dataFile.exists("Model") && (dataFile.getDataAsString("Model")[0] != null)) { t.setModel(dataFile.getDataAsString("Model")[0]); } else { if (dataFile.exists("source")) { t.setSource(dataFile.getDataAsString("source")[0]); if (!dataFile.exists("year")) { throw new EntityLoadingException("Could not find year block."); if (!dataFile.exists("tonnage")) { throw new EntityLoadingException("Could not find weight block."); if (!dataFile.exists("cruiseMP")) { throw new EntityLoadingException("Could not find cruiseMP block."); if (dataFile.exists("jumpingMP")) { t.setOriginalJumpMP(dataFile.getDataAsInt("jumpingMP")[0]); if (dataFile.exists("interface_cockpit")) { t.setInterfaceCockpit(Boolean.parseBoolean(dataFile.getDataAsString("interface_cockpit")[0])); if (!dataFile.exists("armor")) { throw new EntityLoadingException("Could not find armor block."); if (dataFile.exists("armor_type")){
if (!dataFile.exists("Name")) { throw new EntityLoadingException("Could not find name block."); if (dataFile.exists("Model") && (dataFile.getDataAsString("Model")[0] != null)) { t.setModel(dataFile.getDataAsString("Model")[0]); } else { if (dataFile.exists("source")) { t.setSource(dataFile.getDataAsString("source")[0]); if (!dataFile.exists("tonnage")) { throw new EntityLoadingException("Could not find weight block."); if (!dataFile.exists("motion_type")) { throw new EntityLoadingException("Could not find movement block."); if (dataFile.exists("engine_type")) { engineCode = dataFile.getDataAsInt("engine_type")[0]; if (dataFile.exists("fuel")) { t.setFuelTonnage(dataFile.getDataAsDouble("fuel")[0]); if (!dataFile.exists("cruiseMP")) { throw new EntityLoadingException("Could not find cruiseMP block."); if (dataFile.exists("armor_type")) { if (dataFile.getDataAsInt("armor_type")[0] == EquipmentType.T_ARMOR_PATCHWORK) { patchworkArmor = true;
if (!dataFile.exists("Name")) { throw new EntityLoadingException("Could not find name block."); if (dataFile.exists("Model") && (dataFile.getDataAsString("Model")[0] != null)) { t.setModel(dataFile.getDataAsString("Model")[0]); } else { if (dataFile.exists("source")) { t.setSource(dataFile.getDataAsString("source")[0]); if (!dataFile.exists("tonnage")) { throw new EntityLoadingException("Could not find weight block."); if (!dataFile.exists("motion_type")) { throw new EntityLoadingException("Could not find movement block."); if (dataFile.exists("engine_type")) { engineCode = dataFile.getDataAsInt("engine_type")[0]; if (dataFile.exists("fuel")) { t.setFuelTonnage(dataFile.getDataAsDouble("fuel")[0]); if (!dataFile.exists("cruiseMP")) { throw new EntityLoadingException("Could not find cruiseMP block."); if (dataFile.exists("internal_type")) { t.setStructureType(dataFile.getDataAsInt("internal_type")[0]); } else {
if (!dataFile.exists("Name")) { throw new EntityLoadingException("Could not find name block."); if (dataFile.exists("Model") && (dataFile.getDataAsString("Model")[0] != null)) { a.setModel(dataFile.getDataAsString("Model")[0]); } else { if (dataFile.exists("source")) { a.setSource(dataFile.getDataAsString("source")[0]); if (!dataFile.exists("tonnage")) { throw new EntityLoadingException("Could not find weight block."); if (!dataFile.exists("fuel")) { throw new EntityLoadingException("Could not find fuel block."); if (dataFile.exists("engine_type")) { engineCode = dataFile.getDataAsInt("engine_type")[0]; if (!dataFile.exists("SafeThrust")) { throw new EntityLoadingException("Could not find SafeThrust block."); if (dataFile.exists("armor_type")) { if (dataFile.getDataAsInt("armor_type")[0] == EquipmentType.T_ARMOR_PATCHWORK) { patchworkArmor = true; if (!patchworkArmor && dataFile.exists("armor_tech")) { a.setArmorTechLevel(dataFile.getDataAsInt("armor_tech")[0]);
if (dataFile.exists("source")) { t.setSource(dataFile.getDataAsString("source")[0]); if (!dataFile.exists("Name")) { throw new EntityLoadingException("Could not find name block."); if (dataFile.exists("Model") && (dataFile.getDataAsString("Model")[0] != null)) { t.setModel(dataFile.getDataAsString("Model")[0]); } else { if (!dataFile.exists("tonnage")) { throw new EntityLoadingException("Could not find weight block."); if (!dataFile.exists("motion_type")) { throw new EntityLoadingException("Could not find movement block."); if (dataFile.exists("engine_type")) { engineCode = dataFile.getDataAsInt("engine_type")[0]; if (dataFile.exists("fuel")) { t.setFuelTonnage(dataFile.getDataAsDouble("fuel")[0]); if (!dataFile.exists("cruiseMP")) { throw new EntityLoadingException("Could not find cruiseMP block."); if (dataFile.exists("armor_type")) { if (dataFile.getDataAsInt("armor_type")[0] == EquipmentType.T_ARMOR_PATCHWORK) { patchworkArmor = true;
if (!dataFile.exists("Name")) { throw new EntityLoadingException("Could not find name block."); if (dataFile.exists("Model") && (dataFile.getDataAsString("Model")[0] != null)) { t.setModel(dataFile.getDataAsString("Model")[0]); } else { if (dataFile.exists("source")) { t.setSource(dataFile.getDataAsString("source")[0]); if (!dataFile.exists("tonnage")) { throw new EntityLoadingException("Could not find weight block."); if (!dataFile.exists("motion_type")) { throw new EntityLoadingException("Could not find movement block."); if (dataFile.exists("engine_type")) { engineCode = dataFile.getDataAsInt("engine_type")[0]; if (!dataFile.exists("cruiseMP")) { throw new EntityLoadingException("Could not find cruiseMP block."); if (dataFile.exists("internal_type")) { t.setStructureType(dataFile.getDataAsInt("internal_type")[0]); } else { if (!dataFile.exists("armor")) { throw new EntityLoadingException("Could not find armor block.");
if ((nLoc == Aero.LOC_NOSE) && dataFile.exists("transporters")) { String[] transporters = dataFile.getDataAsString("transporters"); for (String transporter : transporters) {
if (!dataFile.exists("Name")) { throw new EntityLoadingException("Could not find name block."); if (dataFile.exists("Model") && (dataFile.getDataAsString("Model")[0] != null)) { a.setModel(dataFile.getDataAsString("Model")[0]); } else { if (!dataFile.exists("tonnage")) { throw new EntityLoadingException("Could not find weight block."); if (!dataFile.exists("heatsinks")) { throw new EntityLoadingException("Could not find heatsinks block."); if (dataFile.exists("omnipodheatsinks")) { a.setPodHeatSinks(dataFile.getDataAsInt("omnipodheatsinks")[0]); if (!dataFile.exists("sink_type")) { throw new EntityLoadingException("Could not find sink_type block."); if (!dataFile.exists("fuel")) { throw new EntityLoadingException("Could not find fuel block."); if (dataFile.exists("engine_type")) { engineCode = dataFile.getDataAsInt("engine_type")[0]; if (!dataFile.exists("SafeThrust")) { throw new EntityLoadingException("Could not find SafeThrust block."); if (dataFile.exists("cockpit_type")) {
protected void addTransports(Entity e) { if (dataFile.exists("transporters")) { String[] transporters = dataFile.getDataAsString("transporters"); HashSet<Integer> usedBayNumbers = new HashSet<>();