示例#1
0
  public float getTankWeightTurret() {
    float weight = 0f;

    // For omni vees, the base chassis sets a turret weight
    if (tank.isOmni() && tank.getBaseChassisTurretWeight() >= 0) {
      weight = tank.getBaseChassisTurretWeight();
    } else {
      // For non-omnis, count up the weight of eq in the turret
      for (Mounted m : tank.getEquipment()) {
        if ((m.getLocation() == tank.getLocTurret()) && !(m.getType() instanceof AmmoType)) {
          weight += m.getType().getTonnage(tank);
        }
      }
      // Turrets weight 10% of the weight of weapons in them
      weight = weight / 10.0f;
    }

    if (tank.isSupportVehicle()) {
      if (getEntity().getWeight() < 5) {
        return TestEntity.ceil(weight, CEIL_KILO);
      } else {
        return TestEntity.ceil(weight, CEIL_HALFTON);
      }
    } else {
      return TestEntity.ceilMaxHalf(weight, getWeightCeilingTurret());
    }
  }
示例#2
0
 protected static Structure getStructure(Tank tank) {
   if (tank.isSupportVehicle()) {
     return new SupportVeeStructure(tank);
   }
   int type = EquipmentType.T_STRUCTURE_STANDARD;
   if (tank.getStructureType() == 1) {
     type = EquipmentType.T_STRUCTURE_ENDO_STEEL;
   }
   return new Structure(type, tank.isSuperHeavy(), tank.getMovementMode());
 }