public boolean addCockpit(){
  if (getEmptyCriticals(LOC_HEAD) < 5) {
    return false;
  }
  addCritical(LOC_HEAD,0,new CriticalSlot(CriticalSlot.TYPE_SYSTEM,SYSTEM_LIFE_SUPPORT));
  addCritical(LOC_HEAD,1,new CriticalSlot(CriticalSlot.TYPE_SYSTEM,SYSTEM_SENSORS));
  addCritical(LOC_HEAD,2,new CriticalSlot(CriticalSlot.TYPE_SYSTEM,SYSTEM_COCKPIT));
  addCritical(LOC_HEAD,4,new CriticalSlot(CriticalSlot.TYPE_SYSTEM,SYSTEM_SENSORS));
  addCritical(LOC_HEAD,5,new CriticalSlot(CriticalSlot.TYPE_SYSTEM,SYSTEM_LIFE_SUPPORT));
  if (isSuperHeavy()) {
    if (this instanceof TripodMech) {
      setCockpitType(COCKPIT_SUPERHEAVY_TRIPOD);
    }
 else     if (isIndustrial()) {
      setCockpitType(COCKPIT_SUPERHEAVY_INDUSTRIAL);
    }
 else {
      setCockpitType(COCKPIT_SUPERHEAVY);
    }
  }
 else   if (this instanceof TripodMech) {
    setCockpitType(COCKPIT_TRIPOD);
  }
 else {
    setCockpitType(COCKPIT_STANDARD);
  }
  return true;
}

public boolean addCockpit ( ) { if ( getEmptyCriticals ( LOC_HEAD ) < 5 ) { return false ; } addCritical ( LOC_HEAD , 0 , new CriticalSlot ( CriticalSlot . TYPE_SYSTEM , SYSTEM_LIFE_SUPPORT ) ) ; addCritical ( LOC_HEAD , 1 , new CriticalSlot ( CriticalSlot . TYPE_SYSTEM , SYSTEM_SENSORS ) ) ; addCritical ( LOC_HEAD , 2 , new CriticalSlot ( CriticalSlot . TYPE_SYSTEM , SYSTEM_COCKPIT ) ) ; addCritical ( LOC_HEAD , 4 , new CriticalSlot ( CriticalSlot . TYPE_SYSTEM , SYSTEM_SENSORS ) ) ; addCritical ( LOC_HEAD , 5 , new CriticalSlot ( CriticalSlot . TYPE_SYSTEM , SYSTEM_LIFE_SUPPORT ) ) ; if ( isSuperHeavy ( ) ) { if ( this instanceof TripodMech ) { setCockpitType ( COCKPIT_SUPERHEAVY_TRIPOD ) ; } else if ( isIndustrial ( ) ) { setCockpitType ( COCKPIT_SUPERHEAVY_INDUSTRIAL ) ; } else { setCockpitType ( COCKPIT_SUPERHEAVY ) ; } } else if ( this instanceof TripodMech ) { setCockpitType ( COCKPIT_TRIPOD ) ; } else { setCockpitType ( COCKPIT_STANDARD ) ; } return true ; }
add the critical slots necessary for a standard cockpit . note : this is part of the mek creation public api , and might not be referenced by any megamek code .
