public org.bwapi.proxy.messages.GameMessages.Unit buildPartial() {
        org.bwapi.proxy.messages.GameMessages.Unit result = new org.bwapi.proxy.messages.GameMessages.Unit(this);
        int from_bitField0_ = bitField0_;
        int from_bitField1_ = bitField1_;
        int from_bitField2_ = bitField2_;
        int from_bitField3_ = bitField3_;
        int to_bitField0_ = 0;
        int to_bitField1_ = 0;
        int to_bitField2_ = 0;
        int to_bitField3_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        if (theIDBuilder_ == null) {
          result.theID_ = theID_;
        } else {
          result.theID_ = theIDBuilder_.build();
        }
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        result.player_ = player_;
        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
          to_bitField0_ |= 0x00000004;
        }
        if (typeBuilder_ == null) {
          result.type_ = type_;
        } else {
          result.type_ = typeBuilder_.build();
        }
        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
          to_bitField0_ |= 0x00000008;
        }
        if (initialTypeBuilder_ == null) {
          result.initialType_ = initialType_;
        } else {
          result.initialType_ = initialTypeBuilder_.build();
        }
        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
          to_bitField0_ |= 0x00000010;
        }
        result.hitPoints_ = hitPoints_;
        if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
          to_bitField0_ |= 0x00000020;
        }
        result.initialHitPoints_ = initialHitPoints_;
        if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
          to_bitField0_ |= 0x00000040;
        }
        result.shields_ = shields_;
        if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
          to_bitField0_ |= 0x00000080;
        }
        result.energy_ = energy_;
        if (((from_bitField0_ & 0x00000100) == 0x00000100)) {
          to_bitField0_ |= 0x00000100;
        }
        result.resources_ = resources_;
        if (((from_bitField0_ & 0x00000200) == 0x00000200)) {
          to_bitField0_ |= 0x00000200;
        }
        result.resourceGroup_ = resourceGroup_;
        if (((from_bitField0_ & 0x00000400) == 0x00000400)) {
          to_bitField0_ |= 0x00000400;
        }
        result.initialResources_ = initialResources_;
        if (((from_bitField0_ & 0x00000800) == 0x00000800)) {
          to_bitField0_ |= 0x00000800;
        }
        result.killCount_ = killCount_;
        if (((from_bitField0_ & 0x00001000) == 0x00001000)) {
          to_bitField0_ |= 0x00001000;
        }
        result.groundWeaponCooldown_ = groundWeaponCooldown_;
        if (((from_bitField0_ & 0x00002000) == 0x00002000)) {
          to_bitField0_ |= 0x00002000;
        }
        result.airWeaponCooldown_ = airWeaponCooldown_;
        if (((from_bitField0_ & 0x00004000) == 0x00004000)) {
          to_bitField0_ |= 0x00004000;
        }
        result.spellCooldown_ = spellCooldown_;
        if (((from_bitField0_ & 0x00008000) == 0x00008000)) {
          to_bitField0_ |= 0x00008000;
        }
        result.defenseMatrixPoints_ = defenseMatrixPoints_;
        if (((from_bitField0_ & 0x00010000) == 0x00010000)) {
          to_bitField0_ |= 0x00010000;
        }
        result.defenseMatrixTimer_ = defenseMatrixTimer_;
        if (((from_bitField0_ & 0x00020000) == 0x00020000)) {
          to_bitField0_ |= 0x00020000;
        }
        result.ensnareTimer_ = ensnareTimer_;
        if (((from_bitField0_ & 0x00040000) == 0x00040000)) {
          to_bitField0_ |= 0x00040000;
        }
        result.irradiateTimer_ = irradiateTimer_;
        if (((from_bitField0_ & 0x00080000) == 0x00080000)) {
          to_bitField0_ |= 0x00080000;
        }
        result.lockdownTimer_ = lockdownTimer_;
        if (((from_bitField0_ & 0x00100000) == 0x00100000)) {
          to_bitField0_ |= 0x00100000;
        }
        result.maelstromTimer_ = maelstromTimer_;
        if (((from_bitField0_ & 0x00200000) == 0x00200000)) {
          to_bitField0_ |= 0x00200000;
        }
        result.plagueTimer_ = plagueTimer_;
        if (((from_bitField0_ & 0x00400000) == 0x00400000)) {
          to_bitField0_ |= 0x00400000;
        }
        result.removeTimer_ = removeTimer_;
        if (((from_bitField0_ & 0x00800000) == 0x00800000)) {
          to_bitField0_ |= 0x00800000;
        }
        result.stasisTimer_ = stasisTimer_;
        if (((from_bitField0_ & 0x01000000) == 0x01000000)) {
          to_bitField0_ |= 0x01000000;
        }
        result.stimTimer_ = stimTimer_;
        if (((from_bitField0_ & 0x02000000) == 0x02000000)) {
          to_bitField0_ |= 0x02000000;
        }
        if (positionBuilder_ == null) {
          result.position_ = position_;
        } else {
          result.position_ = positionBuilder_.build();
        }
        if (((from_bitField0_ & 0x04000000) == 0x04000000)) {
          to_bitField0_ |= 0x04000000;
        }
        if (initialPositionBuilder_ == null) {
          result.initialPosition_ = initialPosition_;
        } else {
          result.initialPosition_ = initialPositionBuilder_.build();
        }
        if (((from_bitField0_ & 0x08000000) == 0x08000000)) {
          to_bitField0_ |= 0x08000000;
        }
        if (tilePositionBuilder_ == null) {
          result.tilePosition_ = tilePosition_;
        } else {
          result.tilePosition_ = tilePositionBuilder_.build();
        }
        if (((from_bitField0_ & 0x10000000) == 0x10000000)) {
          to_bitField0_ |= 0x10000000;
        }
        if (initialTilePositionBuilder_ == null) {
          result.initialTilePosition_ = initialTilePosition_;
        } else {
          result.initialTilePosition_ = initialTilePositionBuilder_.build();
        }
        if (((from_bitField0_ & 0x20000000) == 0x20000000)) {
          to_bitField0_ |= 0x20000000;
        }
        result.angle_ = angle_;
        if (((from_bitField0_ & 0x40000000) == 0x40000000)) {
          to_bitField0_ |= 0x40000000;
        }
        result.velocityX_ = velocityX_;
        if (((from_bitField0_ & 0x80000000) == 0x80000000)) {
          to_bitField0_ |= 0x80000000;
        }
        result.velocityY_ = velocityY_;
        if (((from_bitField1_ & 0x00000001) == 0x00000001)) {
          to_bitField1_ |= 0x00000001;
        }
        if (targetBuilder_ == null) {
          result.target_ = target_;
        } else {
          result.target_ = targetBuilder_.build();
        }
        if (((from_bitField1_ & 0x00000002) == 0x00000002)) {
          to_bitField1_ |= 0x00000002;
        }
        if (targetPositionBuilder_ == null) {
          result.targetPosition_ = targetPosition_;
        } else {
          result.targetPosition_ = targetPositionBuilder_.build();
        }
        if (((from_bitField1_ & 0x00000004) == 0x00000004)) {
          to_bitField1_ |= 0x00000004;
        }
        result.order_ = order_;
        if (((from_bitField1_ & 0x00000008) == 0x00000008)) {
          to_bitField1_ |= 0x00000008;
        }
        if (orderTargetBuilder_ == null) {
          result.orderTarget_ = orderTarget_;
        } else {
          result.orderTarget_ = orderTargetBuilder_.build();
        }
        if (((from_bitField1_ & 0x00000010) == 0x00000010)) {
          to_bitField1_ |= 0x00000010;
        }
        result.orderTimer_ = orderTimer_;
        if (((from_bitField1_ & 0x00000020) == 0x00000020)) {
          to_bitField1_ |= 0x00000020;
        }
        result.secondaryOrder_ = secondaryOrder_;
        if (((from_bitField1_ & 0x00000040) == 0x00000040)) {
          to_bitField1_ |= 0x00000040;
        }
        if (buildUnitBuilder_ == null) {
          result.buildUnit_ = buildUnit_;
        } else {
          result.buildUnit_ = buildUnitBuilder_.build();
        }
        if (((from_bitField1_ & 0x00000080) == 0x00000080)) {
          to_bitField1_ |= 0x00000080;
        }
        result.remainingBuildTime_ = remainingBuildTime_;
        if (((from_bitField1_ & 0x00000100) == 0x00000100)) {
          to_bitField1_ |= 0x00000100;
        }
        result.remainingTrainTime_ = remainingTrainTime_;
        if (trainingQueueBuilder_ == null) {
          if (((bitField1_ & 0x00000200) == 0x00000200)) {
            trainingQueue_ = java.util.Collections.unmodifiableList(trainingQueue_);
            bitField1_ = (bitField1_ & ~0x00000200);
          }
          result.trainingQueue_ = trainingQueue_;
        } else {
          result.trainingQueue_ = trainingQueueBuilder_.build();
        }
        if (((from_bitField1_ & 0x00000400) == 0x00000400)) {
          to_bitField1_ |= 0x00000200;
        }
        if (transportBuilder_ == null) {
          result.transport_ = transport_;
        } else {
          result.transport_ = transportBuilder_.build();
        }
        if (loadedUnitsBuilder_ == null) {
          if (((bitField1_ & 0x00000800) == 0x00000800)) {
            loadedUnits_ = java.util.Collections.unmodifiableList(loadedUnits_);
            bitField1_ = (bitField1_ & ~0x00000800);
          }
          result.loadedUnits_ = loadedUnits_;
        } else {
          result.loadedUnits_ = loadedUnitsBuilder_.build();
        }
        if (((from_bitField1_ & 0x00001000) == 0x00001000)) {
          to_bitField1_ |= 0x00000400;
        }
        result.interceptorCount_ = interceptorCount_;
        if (((from_bitField1_ & 0x00002000) == 0x00002000)) {
          to_bitField1_ |= 0x00000800;
        }
        result.scarabCount_ = scarabCount_;
        if (((from_bitField1_ & 0x00004000) == 0x00004000)) {
          to_bitField1_ |= 0x00001000;
        }
        result.spiderMineCount_ = spiderMineCount_;
        if (((from_bitField1_ & 0x00008000) == 0x00008000)) {
          to_bitField1_ |= 0x00002000;
        }
        result.tech_ = tech_;
        if (((from_bitField1_ & 0x00010000) == 0x00010000)) {
          to_bitField1_ |= 0x00004000;
        }
        result.upgrade_ = upgrade_;
        if (((from_bitField1_ & 0x00020000) == 0x00020000)) {
          to_bitField1_ |= 0x00008000;
        }
        result.remainingResearchTime_ = remainingResearchTime_;
        if (((from_bitField1_ & 0x00040000) == 0x00040000)) {
          to_bitField1_ |= 0x00010000;
        }
        result.remainingUpgradeTime_ = remainingUpgradeTime_;
        if (((from_bitField1_ & 0x00080000) == 0x00080000)) {
          to_bitField1_ |= 0x00020000;
        }
        if (rallyPositionBuilder_ == null) {
          result.rallyPosition_ = rallyPosition_;
        } else {
          result.rallyPosition_ = rallyPositionBuilder_.build();
        }
        if (((from_bitField1_ & 0x00100000) == 0x00100000)) {
          to_bitField1_ |= 0x00040000;
        }
        if (rallyUnitBuilder_ == null) {
          result.rallyUnit_ = rallyUnit_;
        } else {
          result.rallyUnit_ = rallyUnitBuilder_.build();
        }
        if (((from_bitField1_ & 0x00200000) == 0x00200000)) {
          to_bitField1_ |= 0x00080000;
        }
        if (addonBuilder_ == null) {
          result.addon_ = addon_;
        } else {
          result.addon_ = addonBuilder_.build();
        }
        if (((from_bitField1_ & 0x00400000) == 0x00400000)) {
          to_bitField1_ |= 0x00100000;
        }
        if (carrierBuilder_ == null) {
          result.carrier_ = carrier_;
        } else {
          result.carrier_ = carrierBuilder_.build();
        }
        if (interceptorsBuilder_ == null) {
          if (((bitField1_ & 0x00800000) == 0x00800000)) {
            interceptors_ = java.util.Collections.unmodifiableList(interceptors_);
            bitField1_ = (bitField1_ & ~0x00800000);
          }
          result.interceptors_ = interceptors_;
        } else {
          result.interceptors_ = interceptorsBuilder_.build();
        }
        if (((from_bitField1_ & 0x01000000) == 0x01000000)) {
          to_bitField1_ |= 0x00200000;
        }
        if (nydusExitBuilder_ == null) {
          result.nydusExit_ = nydusExit_;
        } else {
          result.nydusExit_ = nydusExitBuilder_.build();
        }
        if (((from_bitField1_ & 0x02000000) == 0x02000000)) {
          to_bitField1_ |= 0x00400000;
        }
        result.exists_ = exists_;
        if (((from_bitField1_ & 0x04000000) == 0x04000000)) {
          to_bitField1_ |= 0x00800000;
        }
        result.hasNuke_ = hasNuke_;
        if (((from_bitField1_ & 0x08000000) == 0x08000000)) {
          to_bitField1_ |= 0x01000000;
        }
        result.accelerating_ = accelerating_;
        if (((from_bitField1_ & 0x10000000) == 0x10000000)) {
          to_bitField1_ |= 0x02000000;
        }
        result.beingConstructed_ = beingConstructed_;
        if (((from_bitField1_ & 0x20000000) == 0x20000000)) {
          to_bitField1_ |= 0x04000000;
        }
        result.beingHealed_ = beingHealed_;
        if (((from_bitField1_ & 0x40000000) == 0x40000000)) {
          to_bitField1_ |= 0x08000000;
        }
        result.blind_ = blind_;
        if (((from_bitField1_ & 0x80000000) == 0x80000000)) {
          to_bitField1_ |= 0x10000000;
        }
        result.braking_ = braking_;
        if (((from_bitField2_ & 0x00000001) == 0x00000001)) {
          to_bitField1_ |= 0x20000000;
        }
        result.burrowed_ = burrowed_;
        if (((from_bitField2_ & 0x00000002) == 0x00000002)) {
          to_bitField1_ |= 0x40000000;
        }
        result.carryingGas_ = carryingGas_;
        if (((from_bitField2_ & 0x00000004) == 0x00000004)) {
          to_bitField1_ |= 0x80000000;
        }
        result.carryingMinerals_ = carryingMinerals_;
        if (((from_bitField2_ & 0x00000008) == 0x00000008)) {
          to_bitField2_ |= 0x00000001;
        }
        result.cloaked_ = cloaked_;
        if (((from_bitField2_ & 0x00000010) == 0x00000010)) {
          to_bitField2_ |= 0x00000002;
        }
        result.completed_ = completed_;
        if (((from_bitField2_ & 0x00000020) == 0x00000020)) {
          to_bitField2_ |= 0x00000004;
        }
        result.constructing_ = constructing_;
        if (((from_bitField2_ & 0x00000040) == 0x00000040)) {
          to_bitField2_ |= 0x00000008;
        }
        result.defenseMatrixed_ = defenseMatrixed_;
        if (((from_bitField2_ & 0x00000080) == 0x00000080)) {
          to_bitField2_ |= 0x00000010;
        }
        result.ensnared_ = ensnared_;
        if (((from_bitField2_ & 0x00000100) == 0x00000100)) {
          to_bitField2_ |= 0x00000020;
        }
        result.following_ = following_;
        if (((from_bitField2_ & 0x00000200) == 0x00000200)) {
          to_bitField2_ |= 0x00000040;
        }
        result.gatheringGas_ = gatheringGas_;
        if (((from_bitField2_ & 0x00000400) == 0x00000400)) {
          to_bitField2_ |= 0x00000080;
        }
        result.gatheringMinerals_ = gatheringMinerals_;
        if (((from_bitField2_ & 0x00000800) == 0x00000800)) {
          to_bitField2_ |= 0x00000100;
        }
        result.hallucination_ = hallucination_;
        if (((from_bitField2_ & 0x00001000) == 0x00001000)) {
          to_bitField2_ |= 0x00000200;
        }
        result.idle_ = idle_;
        if (((from_bitField2_ & 0x00002000) == 0x00002000)) {
          to_bitField2_ |= 0x00000400;
        }
        result.irradiated_ = irradiated_;
        if (((from_bitField2_ & 0x00004000) == 0x00004000)) {
          to_bitField2_ |= 0x00000800;
        }
        result.lifted_ = lifted_;
        if (((from_bitField2_ & 0x00008000) == 0x00008000)) {
          to_bitField2_ |= 0x00001000;
        }
        result.loaded_ = loaded_;
        if (((from_bitField2_ & 0x00010000) == 0x00010000)) {
          to_bitField2_ |= 0x00002000;
        }
        result.lockedDown_ = lockedDown_;
        if (((from_bitField2_ & 0x00020000) == 0x00020000)) {
          to_bitField2_ |= 0x00004000;
        }
        result.maelstrommed_ = maelstrommed_;
        if (((from_bitField2_ & 0x00040000) == 0x00040000)) {
          to_bitField2_ |= 0x00008000;
        }
        result.morphing_ = morphing_;
        if (((from_bitField2_ & 0x00080000) == 0x00080000)) {
          to_bitField2_ |= 0x00010000;
        }
        result.moving_ = moving_;
        if (((from_bitField2_ & 0x00100000) == 0x00100000)) {
          to_bitField2_ |= 0x00020000;
        }
        result.parasited_ = parasited_;
        if (((from_bitField2_ & 0x00200000) == 0x00200000)) {
          to_bitField2_ |= 0x00040000;
        }
        result.patrolling_ = patrolling_;
        if (((from_bitField2_ & 0x00400000) == 0x00400000)) {
          to_bitField2_ |= 0x00080000;
        }
        result.plagued_ = plagued_;
        if (((from_bitField2_ & 0x00800000) == 0x00800000)) {
          to_bitField2_ |= 0x00100000;
        }
        result.repairing_ = repairing_;
        if (((from_bitField2_ & 0x01000000) == 0x01000000)) {
          to_bitField2_ |= 0x00200000;
        }
        result.researching_ = researching_;
        if (((from_bitField2_ & 0x02000000) == 0x02000000)) {
          to_bitField2_ |= 0x00400000;
        }
        result.selected_ = selected_;
        if (((from_bitField2_ & 0x04000000) == 0x04000000)) {
          to_bitField2_ |= 0x00800000;
        }
        result.sieged_ = sieged_;
        if (((from_bitField2_ & 0x08000000) == 0x08000000)) {
          to_bitField2_ |= 0x01000000;
        }
        result.startingAttack_ = startingAttack_;
        if (((from_bitField2_ & 0x10000000) == 0x10000000)) {
          to_bitField2_ |= 0x02000000;
        }
        result.stasised_ = stasised_;
        if (((from_bitField2_ & 0x20000000) == 0x20000000)) {
          to_bitField2_ |= 0x04000000;
        }
        result.stimmed_ = stimmed_;
        if (((from_bitField2_ & 0x40000000) == 0x40000000)) {
          to_bitField2_ |= 0x08000000;
        }
        result.training_ = training_;
        if (((from_bitField2_ & 0x80000000) == 0x80000000)) {
          to_bitField2_ |= 0x10000000;
        }
        result.underStorm_ = underStorm_;
        if (((from_bitField3_ & 0x00000001) == 0x00000001)) {
          to_bitField2_ |= 0x20000000;
        }
        result.underAttack_ = underAttack_;
        if (((from_bitField3_ & 0x00000002) == 0x00000002)) {
          to_bitField2_ |= 0x40000000;
        }
        result.underDarkSwarm_ = underDarkSwarm_;
        if (((from_bitField3_ & 0x00000004) == 0x00000004)) {
          to_bitField2_ |= 0x80000000;
        }
        result.unpowered_ = unpowered_;
        if (((from_bitField3_ & 0x00000008) == 0x00000008)) {
          to_bitField3_ |= 0x00000001;
        }
        result.upgrading_ = upgrading_;
        if (((from_bitField3_ & 0x00000010) == 0x00000010)) {
          to_bitField3_ |= 0x00000002;
        }
        result.visible_ = visible_;
        if (((from_bitField3_ & 0x00000020) == 0x00000020)) {
          to_bitField3_ |= 0x00000004;
        }
        result.beingGathered_ = beingGathered_;
        if (larvaeBuilder_ == null) {
          if (((bitField3_ & 0x00000040) == 0x00000040)) {
            larvae_ = java.util.Collections.unmodifiableList(larvae_);
            bitField3_ = (bitField3_ & ~0x00000040);
          }
          result.larvae_ = larvae_;
        } else {
          result.larvae_ = larvaeBuilder_.build();
        }
        if (((from_bitField3_ & 0x00000080) == 0x00000080)) {
          to_bitField3_ |= 0x00000008;
        }
        if (hatcheryBuilder_ == null) {
          result.hatchery_ = hatchery_;
        } else {
          result.hatchery_ = hatcheryBuilder_.build();
        }
        if (((from_bitField3_ & 0x00000100) == 0x00000100)) {
          to_bitField3_ |= 0x00000010;
        }
        if (buildTypeBuilder_ == null) {
          result.buildType_ = buildType_;
        } else {
          result.buildType_ = buildTypeBuilder_.build();
        }
        if (((from_bitField3_ & 0x00000200) == 0x00000200)) {
          to_bitField3_ |= 0x00000020;
        }
        result.detected_ = detected_;
        if (((from_bitField3_ & 0x00000400) == 0x00000400)) {
          to_bitField3_ |= 0x00000040;
        }
        result.attacking_ = attacking_;
        if (((from_bitField3_ & 0x00000800) == 0x00000800)) {
          to_bitField3_ |= 0x00000080;
        }
        result.attackFrame_ = attackFrame_;
        if (((from_bitField3_ & 0x00001000) == 0x00001000)) {
          to_bitField3_ |= 0x00000100;
        }
        result.stuck_ = stuck_;
        result.bitField0_ = to_bitField0_;
        result.bitField1_ = to_bitField1_;
        result.bitField2_ = to_bitField2_;
        result.bitField3_ = to_bitField3_;
        onBuilt();
        return result;
      }