public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeInt32(1, id_);
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeBytes(2, getNameBytes());
      }
      for (int i = 0; i < units_.size(); i++) {
        output.writeMessage(3, units_.get(i));
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeEnum(4, race_.getNumber());
      }
      for (int i = 0; i < stances_.size(); i++) {
        output.writeMessage(5, stances_.get(i));
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        output.writeBool(6, neutral_);
      }
      if (((bitField0_ & 0x00000010) == 0x00000010)) {
        output.writeMessage(7, startLocation_);
      }
      if (((bitField0_ & 0x00000020) == 0x00000020)) {
        output.writeBool(8, leftGame_);
      }
      if (((bitField0_ & 0x00000040) == 0x00000040)) {
        output.writeInt32(9, minerals_);
      }
      if (((bitField0_ & 0x00000080) == 0x00000080)) {
        output.writeInt32(10, gas_);
      }
      if (((bitField0_ & 0x00000100) == 0x00000100)) {
        output.writeInt32(11, cumulativeMinerals_);
      }
      if (((bitField0_ & 0x00000200) == 0x00000200)) {
        output.writeInt32(12, cumulativeGas_);
      }
      if (((bitField0_ & 0x00000400) == 0x00000400)) {
        output.writeInt32(13, supplyTotal_);
      }
      if (((bitField0_ & 0x00000800) == 0x00000800)) {
        output.writeInt32(14, supplyUsed_);
      }
      for (int i = 0; i < allUnitCount_.size(); i++) {
        output.writeMessage(15, allUnitCount_.get(i));
      }
      for (int i = 0; i < completedUnitCount_.size(); i++) {
        output.writeMessage(16, completedUnitCount_.get(i));
      }
      for (int i = 0; i < incompleteUnitCount_.size(); i++) {
        output.writeMessage(17, incompleteUnitCount_.get(i));
      }
      for (int i = 0; i < deadUnitCount_.size(); i++) {
        output.writeMessage(18, deadUnitCount_.get(i));
      }
      for (int i = 0; i < killedUnitCount_.size(); i++) {
        output.writeMessage(19, killedUnitCount_.get(i));
      }
      for (int i = 0; i < upgradeLevels_.size(); i++) {
        output.writeMessage(20, upgradeLevels_.get(i));
      }
      for (int i = 0; i < researchedTechs_.size(); i++) {
        output.writeMessage(21, researchedTechs_.get(i));
      }
      for (int i = 0; i < researching_.size(); i++) {
        output.writeMessage(22, researching_.get(i));
      }
      for (int i = 0; i < upgrading_.size(); i++) {
        output.writeMessage(23, upgrading_.get(i));
      }
      if (((bitField0_ & 0x00001000) == 0x00001000)) {
        output.writeBool(24, self_);
      }
      if (((bitField0_ & 0x00002000) == 0x00002000)) {
        output.writeBool(25, victorious_);
      }
      if (((bitField0_ & 0x00004000) == 0x00004000)) {
        output.writeBool(26, defeated_);
      }
      getUnknownFields().writeTo(output);
    }