public Builder clearStartLocation() {
        bitField0_ = (bitField0_ & ~0x00000800);
        startLocation_ = false;
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:messages.BaseLocation)
    }

    static {
      defaultInstance = new BaseLocation(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:messages.BaseLocation)
  }

  public interface ChokepointOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // required int32 id = 7;
    /**
     * <code>required int32 id = 7;</code>
     */
    boolean hasId();
    /**
     * <code>required int32 id = 7;</code>
     */
    int getId();

    // required int32 region1 = 1;
    /**
     * <code>required int32 region1 = 1;</code>
     */
    boolean hasRegion1();
    /**
     * <code>required int32 region1 = 1;</code>
     */
    int getRegion1();

    // required int32 region2 = 2;
    /**
     * <code>required int32 region2 = 2;</code>
     */
    boolean hasRegion2();
    /**
     * <code>required int32 region2 = 2;</code>
     */
    int getRegion2();

    // required .messages.Position side1 = 3;
    /**
     * <code>required .messages.Position side1 = 3;</code>
     */
    boolean hasSide1();
    /**
     * <code>required .messages.Position side1 = 3;</code>
     */
    org.bwapi.proxy.messages.BasicTypes.Position getSide1();
    /**
     * <code>required .messages.Position side1 = 3;</code>
     */
    org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder getSide1OrBuilder();

    // required .messages.Position side2 = 4;
    /**
     * <code>required .messages.Position side2 = 4;</code>
     */
    boolean hasSide2();
    /**
     * <code>required .messages.Position side2 = 4;</code>
     */
    org.bwapi.proxy.messages.BasicTypes.Position getSide2();
    /**
     * <code>required .messages.Position side2 = 4;</code>
     */
    org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder getSide2OrBuilder();

    // required .messages.Position center = 5;
    /**
     * <code>required .messages.Position center = 5;</code>
     */
    boolean hasCenter();
    /**
     * <code>required .messages.Position center = 5;</code>
     */
    org.bwapi.proxy.messages.BasicTypes.Position getCenter();
    /**
     * <code>required .messages.Position center = 5;</code>
     */
    org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder getCenterOrBuilder();

    // required double width = 6;
    /**
     * <code>required double width = 6;</code>
     */
    boolean hasWidth();
    /**
     * <code>required double width = 6;</code>
     */
    double getWidth();
  }
  /**
   * Protobuf type {@code messages.Chokepoint}
   */
  public static final class Chokepoint extends
      com.google.protobuf.GeneratedMessage
      implements ChokepointOrBuilder {
    // Use Chokepoint.newBuilder() to construct.
    private Chokepoint(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private Chokepoint(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final Chokepoint defaultInstance;
    public static Chokepoint getDefaultInstance() {
      return defaultInstance;
    }

    public Chokepoint getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private Chokepoint(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 8: {
              bitField0_ |= 0x00000002;
              region1_ = input.readInt32();
              break;
            }
            case 16: {
              bitField0_ |= 0x00000004;
              region2_ = input.readInt32();
              break;
            }
            case 26: {
              org.bwapi.proxy.messages.BasicTypes.Position.Builder subBuilder = null;
              if (((bitField0_ & 0x00000008) == 0x00000008)) {
                subBuilder = side1_.toBuilder();
              }
              side1_ = input.readMessage(org.bwapi.proxy.messages.BasicTypes.Position.PARSER, extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(side1_);
                side1_ = subBuilder.buildPartial();
              }
              bitField0_ |= 0x00000008;
              break;
            }
            case 34: {
              org.bwapi.proxy.messages.BasicTypes.Position.Builder subBuilder = null;
              if (((bitField0_ & 0x00000010) == 0x00000010)) {
                subBuilder = side2_.toBuilder();
              }
              side2_ = input.readMessage(org.bwapi.proxy.messages.BasicTypes.Position.PARSER, extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(side2_);
                side2_ = subBuilder.buildPartial();
              }
              bitField0_ |= 0x00000010;
              break;
            }
            case 42: {
              org.bwapi.proxy.messages.BasicTypes.Position.Builder subBuilder = null;
              if (((bitField0_ & 0x00000020) == 0x00000020)) {
                subBuilder = center_.toBuilder();
              }
              center_ = input.readMessage(org.bwapi.proxy.messages.BasicTypes.Position.PARSER, extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(center_);
                center_ = subBuilder.buildPartial();
              }
              bitField0_ |= 0x00000020;
              break;
            }
            case 49: {
              bitField0_ |= 0x00000040;
              width_ = input.readDouble();
              break;
            }
            case 56: {
              bitField0_ |= 0x00000001;
              id_ = input.readInt32();
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.bwapi.proxy.messages.TerrainMessages.internal_static_messages_Chokepoint_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.bwapi.proxy.messages.TerrainMessages.internal_static_messages_Chokepoint_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.bwapi.proxy.messages.TerrainMessages.Chokepoint.class, org.bwapi.proxy.messages.TerrainMessages.Chokepoint.Builder.class);
    }

    public static com.google.protobuf.Parser<Chokepoint> PARSER =
        new com.google.protobuf.AbstractParser<Chokepoint>() {
      public Chokepoint parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return new Chokepoint(input, extensionRegistry);
      }
    };

    @java.lang.Override
    public com.google.protobuf.Parser<Chokepoint> getParserForType() {
      return PARSER;
    }

    private int bitField0_;
    // required int32 id = 7;
    public static final int ID_FIELD_NUMBER = 7;
    private int id_;
    /**
     * <code>required int32 id = 7;</code>
     */
    public boolean hasId() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>required int32 id = 7;</code>
     */
    public int getId() {
      return id_;
    }

    // required int32 region1 = 1;
    public static final int REGION1_FIELD_NUMBER = 1;
    private int region1_;
    /**
     * <code>required int32 region1 = 1;</code>
     */
    public boolean hasRegion1() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>required int32 region1 = 1;</code>
     */
    public int getRegion1() {
      return region1_;
    }

    // required int32 region2 = 2;
    public static final int REGION2_FIELD_NUMBER = 2;
    private int region2_;
    /**
     * <code>required int32 region2 = 2;</code>
     */
    public boolean hasRegion2() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>required int32 region2 = 2;</code>
     */
    public int getRegion2() {
      return region2_;
    }

    // required .messages.Position side1 = 3;
    public static final int SIDE1_FIELD_NUMBER = 3;
    private org.bwapi.proxy.messages.BasicTypes.Position side1_;
    /**
     * <code>required .messages.Position side1 = 3;</code>
     */
    public boolean hasSide1() {
      return ((bitField0_ & 0x00000008) == 0x00000008);
    }
    /**
     * <code>required .messages.Position side1 = 3;</code>
     */
    public org.bwapi.proxy.messages.BasicTypes.Position getSide1() {
      return side1_;
    }
    /**
     * <code>required .messages.Position side1 = 3;</code>
     */
    public org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder getSide1OrBuilder() {
      return side1_;
    }

    // required .messages.Position side2 = 4;
    public static final int SIDE2_FIELD_NUMBER = 4;
    private org.bwapi.proxy.messages.BasicTypes.Position side2_;
    /**
     * <code>required .messages.Position side2 = 4;</code>
     */
    public boolean hasSide2() {
      return ((bitField0_ & 0x00000010) == 0x00000010);
    }
    /**
     * <code>required .messages.Position side2 = 4;</code>
     */
    public org.bwapi.proxy.messages.BasicTypes.Position getSide2() {
      return side2_;
    }
    /**
     * <code>required .messages.Position side2 = 4;</code>
     */
    public org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder getSide2OrBuilder() {
      return side2_;
    }

    // required .messages.Position center = 5;
    public static final int CENTER_FIELD_NUMBER = 5;
    private org.bwapi.proxy.messages.BasicTypes.Position center_;
    /**
     * <code>required .messages.Position center = 5;</code>
     */
    public boolean hasCenter() {
      return ((bitField0_ & 0x00000020) == 0x00000020);
    }
    /**
     * <code>required .messages.Position center = 5;</code>
     */
    public org.bwapi.proxy.messages.BasicTypes.Position getCenter() {
      return center_;
    }
    /**
     * <code>required .messages.Position center = 5;</code>
     */
    public org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder getCenterOrBuilder() {
      return center_;
    }

    // required double width = 6;
    public static final int WIDTH_FIELD_NUMBER = 6;
    private double width_;
    /**
     * <code>required double width = 6;</code>
     */
    public boolean hasWidth() {
      return ((bitField0_ & 0x00000040) == 0x00000040);
    }
    /**
     * <code>required double width = 6;</code>
     */
    public double getWidth() {
      return width_;
    }

    private void initFields() {
      id_ = 0;
      region1_ = 0;
      region2_ = 0;
      side1_ = org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance();
      side2_ = org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance();
      center_ = org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance();
      width_ = 0D;
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      if (!hasId()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!hasRegion1()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!hasRegion2()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!hasSide1()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!hasSide2()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!hasCenter()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!hasWidth()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!getSide1().isInitialized()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!getSide2().isInitialized()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!getCenter().isInitialized()) {
        memoizedIsInitialized = 0;
        return false;
      }
      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeInt32(1, region1_);
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeInt32(2, region2_);
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        output.writeMessage(3, side1_);
      }
      if (((bitField0_ & 0x00000010) == 0x00000010)) {
        output.writeMessage(4, side2_);
      }
      if (((bitField0_ & 0x00000020) == 0x00000020)) {
        output.writeMessage(5, center_);
      }
      if (((bitField0_ & 0x00000040) == 0x00000040)) {
        output.writeDouble(6, width_);
      }
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeInt32(7, id_);
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(1, region1_);
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(2, region2_);
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(3, side1_);
      }
      if (((bitField0_ & 0x00000010) == 0x00000010)) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(4, side2_);
      }
      if (((bitField0_ & 0x00000020) == 0x00000020)) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(5, center_);
      }
      if (((bitField0_ & 0x00000040) == 0x00000040)) {
        size += com.google.protobuf.CodedOutputStream
          .computeDoubleSize(6, width_);
      }
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(7, id_);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static org.bwapi.proxy.messages.TerrainMessages.Chokepoint parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Chokepoint parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Chokepoint parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Chokepoint parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Chokepoint parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Chokepoint parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Chokepoint parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Chokepoint parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Chokepoint parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Chokepoint parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(org.bwapi.proxy.messages.TerrainMessages.Chokepoint prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code messages.Chokepoint}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements org.bwapi.proxy.messages.TerrainMessages.ChokepointOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return org.bwapi.proxy.messages.TerrainMessages.internal_static_messages_Chokepoint_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return org.bwapi.proxy.messages.TerrainMessages.internal_static_messages_Chokepoint_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                org.bwapi.proxy.messages.TerrainMessages.Chokepoint.class, org.bwapi.proxy.messages.TerrainMessages.Chokepoint.Builder.class);
      }

      // Construct using org.bwapi.proxy.messages.TerrainMessages.Chokepoint.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          getSide1FieldBuilder();
          getSide2FieldBuilder();
          getCenterFieldBuilder();
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        id_ = 0;
        bitField0_ = (bitField0_ & ~0x00000001);
        region1_ = 0;
        bitField0_ = (bitField0_ & ~0x00000002);
        region2_ = 0;
        bitField0_ = (bitField0_ & ~0x00000004);
        if (side1Builder_ == null) {
          side1_ = org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance();
        } else {
          side1Builder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000008);
        if (side2Builder_ == null) {
          side2_ = org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance();
        } else {
          side2Builder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000010);
        if (centerBuilder_ == null) {
          center_ = org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance();
        } else {
          centerBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000020);
        width_ = 0D;
        bitField0_ = (bitField0_ & ~0x00000040);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return org.bwapi.proxy.messages.TerrainMessages.internal_static_messages_Chokepoint_descriptor;
      }

      public org.bwapi.proxy.messages.TerrainMessages.Chokepoint getDefaultInstanceForType() {
        return org.bwapi.proxy.messages.TerrainMessages.Chokepoint.getDefaultInstance();
      }

      public org.bwapi.proxy.messages.TerrainMessages.Chokepoint build() {
        org.bwapi.proxy.messages.TerrainMessages.Chokepoint result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public org.bwapi.proxy.messages.TerrainMessages.Chokepoint buildPartial() {
        org.bwapi.proxy.messages.TerrainMessages.Chokepoint result = new org.bwapi.proxy.messages.TerrainMessages.Chokepoint(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.id_ = id_;
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        result.region1_ = region1_;
        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
          to_bitField0_ |= 0x00000004;
        }
        result.region2_ = region2_;
        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
          to_bitField0_ |= 0x00000008;
        }
        if (side1Builder_ == null) {
          result.side1_ = side1_;
        } else {
          result.side1_ = side1Builder_.build();
        }
        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
          to_bitField0_ |= 0x00000010;
        }
        if (side2Builder_ == null) {
          result.side2_ = side2_;
        } else {
          result.side2_ = side2Builder_.build();
        }
        if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
          to_bitField0_ |= 0x00000020;
        }
        if (centerBuilder_ == null) {
          result.center_ = center_;
        } else {
          result.center_ = centerBuilder_.build();
        }
        if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
          to_bitField0_ |= 0x00000040;
        }
        result.width_ = width_;
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof org.bwapi.proxy.messages.TerrainMessages.Chokepoint) {
          return mergeFrom((org.bwapi.proxy.messages.TerrainMessages.Chokepoint)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(org.bwapi.proxy.messages.TerrainMessages.Chokepoint other) {
        if (other == org.bwapi.proxy.messages.TerrainMessages.Chokepoint.getDefaultInstance()) return this;
        if (other.hasId()) {
          setId(other.getId());
        }
        if (other.hasRegion1()) {
          setRegion1(other.getRegion1());
        }
        if (other.hasRegion2()) {
          setRegion2(other.getRegion2());
        }
        if (other.hasSide1()) {
          mergeSide1(other.getSide1());
        }
        if (other.hasSide2()) {
          mergeSide2(other.getSide2());
        }
        if (other.hasCenter()) {
          mergeCenter(other.getCenter());
        }
        if (other.hasWidth()) {
          setWidth(other.getWidth());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        if (!hasId()) {
          
          return false;
        }
        if (!hasRegion1()) {
          
          return false;
        }
        if (!hasRegion2()) {
          
          return false;
        }
        if (!hasSide1()) {
          
          return false;
        }
        if (!hasSide2()) {
          
          return false;
        }
        if (!hasCenter()) {
          
          return false;
        }
        if (!hasWidth()) {
          
          return false;
        }
        if (!getSide1().isInitialized()) {
          
          return false;
        }
        if (!getSide2().isInitialized()) {
          
          return false;
        }
        if (!getCenter().isInitialized()) {
          
          return false;
        }
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        org.bwapi.proxy.messages.TerrainMessages.Chokepoint parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (org.bwapi.proxy.messages.TerrainMessages.Chokepoint) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // required int32 id = 7;
      private int id_ ;
      /**
       * <code>required int32 id = 7;</code>
       */
      public boolean hasId() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>required int32 id = 7;</code>
       */
      public int getId() {
        return id_;
      }
      /**
       * <code>required int32 id = 7;</code>
       */
      public Builder setId(int value) {
        bitField0_ |= 0x00000001;
        id_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>required int32 id = 7;</code>
       */
      public Builder clearId() {
        bitField0_ = (bitField0_ & ~0x00000001);
        id_ = 0;
        onChanged();
        return this;
      }

      // required int32 region1 = 1;
      private int region1_ ;
      /**
       * <code>required int32 region1 = 1;</code>
       */
      public boolean hasRegion1() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      /**
       * <code>required int32 region1 = 1;</code>
       */
      public int getRegion1() {
        return region1_;
      }
      /**
       * <code>required int32 region1 = 1;</code>
       */
      public Builder setRegion1(int value) {
        bitField0_ |= 0x00000002;
        region1_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>required int32 region1 = 1;</code>
       */
      public Builder clearRegion1() {
        bitField0_ = (bitField0_ & ~0x00000002);
        region1_ = 0;
        onChanged();
        return this;
      }

      // required int32 region2 = 2;
      private int region2_ ;
      /**
       * <code>required int32 region2 = 2;</code>
       */
      public boolean hasRegion2() {
        return ((bitField0_ & 0x00000004) == 0x00000004);
      }
      /**
       * <code>required int32 region2 = 2;</code>
       */
      public int getRegion2() {
        return region2_;
      }
      /**
       * <code>required int32 region2 = 2;</code>
       */
      public Builder setRegion2(int value) {
        bitField0_ |= 0x00000004;
        region2_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>required int32 region2 = 2;</code>
       */
      public Builder clearRegion2() {
        bitField0_ = (bitField0_ & ~0x00000004);
        region2_ = 0;
        onChanged();
        return this;
      }

      // required .messages.Position side1 = 3;
      private org.bwapi.proxy.messages.BasicTypes.Position side1_ = org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance();
      private com.google.protobuf.SingleFieldBuilder<
          org.bwapi.proxy.messages.BasicTypes.Position, org.bwapi.proxy.messages.BasicTypes.Position.Builder, org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder> side1Builder_;
      /**
       * <code>required .messages.Position side1 = 3;</code>
       */
      public boolean hasSide1() {
        return ((bitField0_ & 0x00000008) == 0x00000008);
      }
      /**
       * <code>required .messages.Position side1 = 3;</code>
       */
      public org.bwapi.proxy.messages.BasicTypes.Position getSide1() {
        if (side1Builder_ == null) {
          return side1_;
        } else {
          return side1Builder_.getMessage();
        }
      }
      /**
       * <code>required .messages.Position side1 = 3;</code>
       */
      public Builder setSide1(org.bwapi.proxy.messages.BasicTypes.Position value) {
        if (side1Builder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          side1_ = value;
          onChanged();
        } else {
          side1Builder_.setMessage(value);
        }
        bitField0_ |= 0x00000008;
        return this;
      }
      /**
       * <code>required .messages.Position side1 = 3;</code>
       */
      public Builder setSide1(
          org.bwapi.proxy.messages.BasicTypes.Position.Builder builderForValue) {
        if (side1Builder_ == null) {
          side1_ = builderForValue.build();
          onChanged();
        } else {
          side1Builder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000008;
        return this;
      }
      /**
       * <code>required .messages.Position side1 = 3;</code>
       */
      public Builder mergeSide1(org.bwapi.proxy.messages.BasicTypes.Position value) {
        if (side1Builder_ == null) {
          if (((bitField0_ & 0x00000008) == 0x00000008) &&
              side1_ != org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance()) {
            side1_ =
              org.bwapi.proxy.messages.BasicTypes.Position.newBuilder(side1_).mergeFrom(value).buildPartial();
          } else {
            side1_ = value;
          }
          onChanged();
        } else {
          side1Builder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000008;
        return this;
      }
      /**
       * <code>required .messages.Position side1 = 3;</code>
       */
      public Builder clearSide1() {
        if (side1Builder_ == null) {
          side1_ = org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance();
          onChanged();
        } else {
          side1Builder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000008);
        return this;
      }
      /**
       * <code>required .messages.Position side1 = 3;</code>
       */
      public org.bwapi.proxy.messages.BasicTypes.Position.Builder getSide1Builder() {
        bitField0_ |= 0x00000008;
        onChanged();
        return getSide1FieldBuilder().getBuilder();
      }
      /**
       * <code>required .messages.Position side1 = 3;</code>
       */
      public org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder getSide1OrBuilder() {
        if (side1Builder_ != null) {
          return side1Builder_.getMessageOrBuilder();
        } else {
          return side1_;
        }
      }
      /**
       * <code>required .messages.Position side1 = 3;</code>
       */
      private com.google.protobuf.SingleFieldBuilder<
          org.bwapi.proxy.messages.BasicTypes.Position, org.bwapi.proxy.messages.BasicTypes.Position.Builder, org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder> 
          getSide1FieldBuilder() {
        if (side1Builder_ == null) {
          side1Builder_ = new com.google.protobuf.SingleFieldBuilder<
              org.bwapi.proxy.messages.BasicTypes.Position, org.bwapi.proxy.messages.BasicTypes.Position.Builder, org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder>(
                  side1_,
                  getParentForChildren(),
                  isClean());
          side1_ = null;
        }
        return side1Builder_;
      }

      // required .messages.Position side2 = 4;
      private org.bwapi.proxy.messages.BasicTypes.Position side2_ = org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance();
      private com.google.protobuf.SingleFieldBuilder<
          org.bwapi.proxy.messages.BasicTypes.Position, org.bwapi.proxy.messages.BasicTypes.Position.Builder, org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder> side2Builder_;
      /**
       * <code>required .messages.Position side2 = 4;</code>
       */
      public boolean hasSide2() {
        return ((bitField0_ & 0x00000010) == 0x00000010);
      }
      /**
       * <code>required .messages.Position side2 = 4;</code>
       */
      public org.bwapi.proxy.messages.BasicTypes.Position getSide2() {
        if (side2Builder_ == null) {
          return side2_;
        } else {
          return side2Builder_.getMessage();
        }
      }
      /**
       * <code>required .messages.Position side2 = 4;</code>
       */
      public Builder setSide2(org.bwapi.proxy.messages.BasicTypes.Position value) {
        if (side2Builder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          side2_ = value;
          onChanged();
        } else {
          side2Builder_.setMessage(value);
        }
        bitField0_ |= 0x00000010;
        return this;
      }
      /**
       * <code>required .messages.Position side2 = 4;</code>
       */
      public Builder setSide2(
          org.bwapi.proxy.messages.BasicTypes.Position.Builder builderForValue) {
        if (side2Builder_ == null) {
          side2_ = builderForValue.build();
          onChanged();
        } else {
          side2Builder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000010;
        return this;
      }
      /**
       * <code>required .messages.Position side2 = 4;</code>
       */
      public Builder mergeSide2(org.bwapi.proxy.messages.BasicTypes.Position value) {
        if (side2Builder_ == null) {
          if (((bitField0_ & 0x00000010) == 0x00000010) &&
              side2_ != org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance()) {
            side2_ =
              org.bwapi.proxy.messages.BasicTypes.Position.newBuilder(side2_).mergeFrom(value).buildPartial();
          } else {
            side2_ = value;
          }
          onChanged();
        } else {
          side2Builder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000010;
        return this;
      }
      /**
       * <code>required .messages.Position side2 = 4;</code>
       */
      public Builder clearSide2() {
        if (side2Builder_ == null) {
          side2_ = org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance();
          onChanged();
        } else {
          side2Builder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000010);
        return this;
      }
      /**
       * <code>required .messages.Position side2 = 4;</code>
       */
      public org.bwapi.proxy.messages.BasicTypes.Position.Builder getSide2Builder() {
        bitField0_ |= 0x00000010;
        onChanged();
        return getSide2FieldBuilder().getBuilder();
      }
      /**
       * <code>required .messages.Position side2 = 4;</code>
       */
      public org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder getSide2OrBuilder() {
        if (side2Builder_ != null) {
          return side2Builder_.getMessageOrBuilder();
        } else {
          return side2_;
        }
      }
      /**
       * <code>required .messages.Position side2 = 4;</code>
       */
      private com.google.protobuf.SingleFieldBuilder<
          org.bwapi.proxy.messages.BasicTypes.Position, org.bwapi.proxy.messages.BasicTypes.Position.Builder, org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder> 
          getSide2FieldBuilder() {
        if (side2Builder_ == null) {
          side2Builder_ = new com.google.protobuf.SingleFieldBuilder<
              org.bwapi.proxy.messages.BasicTypes.Position, org.bwapi.proxy.messages.BasicTypes.Position.Builder, org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder>(
                  side2_,
                  getParentForChildren(),
                  isClean());
          side2_ = null;
        }
        return side2Builder_;
      }

      // required .messages.Position center = 5;
      private org.bwapi.proxy.messages.BasicTypes.Position center_ = org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance();
      private com.google.protobuf.SingleFieldBuilder<
          org.bwapi.proxy.messages.BasicTypes.Position, org.bwapi.proxy.messages.BasicTypes.Position.Builder, org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder> centerBuilder_;
      /**
       * <code>required .messages.Position center = 5;</code>
       */
      public boolean hasCenter() {
        return ((bitField0_ & 0x00000020) == 0x00000020);
      }
      /**
       * <code>required .messages.Position center = 5;</code>
       */
      public org.bwapi.proxy.messages.BasicTypes.Position getCenter() {
        if (centerBuilder_ == null) {
          return center_;
        } else {
          return centerBuilder_.getMessage();
        }
      }
      /**
       * <code>required .messages.Position center = 5;</code>
       */
      public Builder setCenter(org.bwapi.proxy.messages.BasicTypes.Position value) {
        if (centerBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          center_ = value;
          onChanged();
        } else {
          centerBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000020;
        return this;
      }
      /**
       * <code>required .messages.Position center = 5;</code>
       */
      public Builder setCenter(
          org.bwapi.proxy.messages.BasicTypes.Position.Builder builderForValue) {
        if (centerBuilder_ == null) {
          center_ = builderForValue.build();
          onChanged();
        } else {
          centerBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000020;
        return this;
      }
      /**
       * <code>required .messages.Position center = 5;</code>
       */
      public Builder mergeCenter(org.bwapi.proxy.messages.BasicTypes.Position value) {
        if (centerBuilder_ == null) {
          if (((bitField0_ & 0x00000020) == 0x00000020) &&
              center_ != org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance()) {
            center_ =
              org.bwapi.proxy.messages.BasicTypes.Position.newBuilder(center_).mergeFrom(value).buildPartial();
          } else {
            center_ = value;
          }
          onChanged();
        } else {
          centerBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000020;
        return this;
      }
      /**
       * <code>required .messages.Position center = 5;</code>
       */
      public Builder clearCenter() {
        if (centerBuilder_ == null) {
          center_ = org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance();
          onChanged();
        } else {
          centerBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000020);
        return this;
      }
      /**
       * <code>required .messages.Position center = 5;</code>
       */
      public org.bwapi.proxy.messages.BasicTypes.Position.Builder getCenterBuilder() {
        bitField0_ |= 0x00000020;
        onChanged();
        return getCenterFieldBuilder().getBuilder();
      }
      /**
       * <code>required .messages.Position center = 5;</code>
       */
      public org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder getCenterOrBuilder() {
        if (centerBuilder_ != null) {
          return centerBuilder_.getMessageOrBuilder();
        } else {
          return center_;
        }
      }
      /**
       * <code>required .messages.Position center = 5;</code>
       */
      private com.google.protobuf.SingleFieldBuilder<
          org.bwapi.proxy.messages.BasicTypes.Position, org.bwapi.proxy.messages.BasicTypes.Position.Builder, org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder> 
          getCenterFieldBuilder() {
        if (centerBuilder_ == null) {
          centerBuilder_ = new com.google.protobuf.SingleFieldBuilder<
              org.bwapi.proxy.messages.BasicTypes.Position, org.bwapi.proxy.messages.BasicTypes.Position.Builder, org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder>(
                  center_,
                  getParentForChildren(),
                  isClean());
          center_ = null;
        }
        return centerBuilder_;
      }

      // required double width = 6;
      private double width_ ;
      /**
       * <code>required double width = 6;</code>
       */
      public boolean hasWidth() {
        return ((bitField0_ & 0x00000040) == 0x00000040);
      }
      /**
       * <code>required double width = 6;</code>
       */
      public double getWidth() {
        return width_;
      }
      /**
       * <code>required double width = 6;</code>
       */
      public Builder setWidth(double value) {
        bitField0_ |= 0x00000040;
        width_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>required double width = 6;</code>
       */
      public Builder clearWidth() {
        bitField0_ = (bitField0_ & ~0x00000040);
        width_ = 0D;
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:messages.Chokepoint)
    }

    static {
      defaultInstance = new Chokepoint(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:messages.Chokepoint)
  }

  public interface PolygonOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // repeated .messages.Position vertices = 1;
    /**
     * <code>repeated .messages.Position vertices = 1;</code>
     */
    java.util.List<org.bwapi.proxy.messages.BasicTypes.Position> 
        getVerticesList();
    /**
     * <code>repeated .messages.Position vertices = 1;</code>
     */
    org.bwapi.proxy.messages.BasicTypes.Position getVertices(int index);
    /**
     * <code>repeated .messages.Position vertices = 1;</code>
     */
    int getVerticesCount();
    /**
     * <code>repeated .messages.Position vertices = 1;</code>
     */
    java.util.List<? extends org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder> 
        getVerticesOrBuilderList();
    /**
     * <code>repeated .messages.Position vertices = 1;</code>
     */
    org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder getVerticesOrBuilder(
        int index);

    // required double area = 2;
    /**
     * <code>required double area = 2;</code>
     */
    boolean hasArea();
    /**
     * <code>required double area = 2;</code>
     */
    double getArea();

    // required double perimeter = 3;
    /**
     * <code>required double perimeter = 3;</code>
     */
    boolean hasPerimeter();
    /**
     * <code>required double perimeter = 3;</code>
     */
    double getPerimeter();

    // required .messages.Position center = 4;
    /**
     * <code>required .messages.Position center = 4;</code>
     */
    boolean hasCenter();
    /**
     * <code>required .messages.Position center = 4;</code>
     */
    org.bwapi.proxy.messages.BasicTypes.Position getCenter();
    /**
     * <code>required .messages.Position center = 4;</code>
     */
    org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder getCenterOrBuilder();

    // repeated .messages.Polygon holes = 5;
    /**
     * <code>repeated .messages.Polygon holes = 5;</code>
     *
     * <pre>
     *bool isInside(BWAPI::Position p) const;
     *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
     * </pre>
     */
    java.util.List<org.bwapi.proxy.messages.TerrainMessages.Polygon> 
        getHolesList();
    /**
     * <code>repeated .messages.Polygon holes = 5;</code>
     *
     * <pre>
     *bool isInside(BWAPI::Position p) const;
     *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
     * </pre>
     */
    org.bwapi.proxy.messages.TerrainMessages.Polygon getHoles(int index);
    /**
     * <code>repeated .messages.Polygon holes = 5;</code>
     *
     * <pre>
     *bool isInside(BWAPI::Position p) const;
     *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
     * </pre>
     */
    int getHolesCount();
    /**
     * <code>repeated .messages.Polygon holes = 5;</code>
     *
     * <pre>
     *bool isInside(BWAPI::Position p) const;
     *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
     * </pre>
     */
    java.util.List<? extends org.bwapi.proxy.messages.TerrainMessages.PolygonOrBuilder> 
        getHolesOrBuilderList();
    /**
     * <code>repeated .messages.Polygon holes = 5;</code>
     *
     * <pre>
     *bool isInside(BWAPI::Position p) const;
     *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
     * </pre>
     */
    org.bwapi.proxy.messages.TerrainMessages.PolygonOrBuilder getHolesOrBuilder(
        int index);
  }
  /**
   * Protobuf type {@code messages.Polygon}
   */
  public static final class Polygon extends
      com.google.protobuf.GeneratedMessage
      implements PolygonOrBuilder {
    // Use Polygon.newBuilder() to construct.
    private Polygon(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private Polygon(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final Polygon defaultInstance;
    public static Polygon getDefaultInstance() {
      return defaultInstance;
    }

    public Polygon getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private Polygon(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
                vertices_ = new java.util.ArrayList<org.bwapi.proxy.messages.BasicTypes.Position>();
                mutable_bitField0_ |= 0x00000001;
              }
              vertices_.add(input.readMessage(org.bwapi.proxy.messages.BasicTypes.Position.PARSER, extensionRegistry));
              break;
            }
            case 17: {
              bitField0_ |= 0x00000001;
              area_ = input.readDouble();
              break;
            }
            case 25: {
              bitField0_ |= 0x00000002;
              perimeter_ = input.readDouble();
              break;
            }
            case 34: {
              org.bwapi.proxy.messages.BasicTypes.Position.Builder subBuilder = null;
              if (((bitField0_ & 0x00000004) == 0x00000004)) {
                subBuilder = center_.toBuilder();
              }
              center_ = input.readMessage(org.bwapi.proxy.messages.BasicTypes.Position.PARSER, extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(center_);
                center_ = subBuilder.buildPartial();
              }
              bitField0_ |= 0x00000004;
              break;
            }
            case 42: {
              if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
                holes_ = new java.util.ArrayList<org.bwapi.proxy.messages.TerrainMessages.Polygon>();
                mutable_bitField0_ |= 0x00000010;
              }
              holes_.add(input.readMessage(org.bwapi.proxy.messages.TerrainMessages.Polygon.PARSER, extensionRegistry));
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
          vertices_ = java.util.Collections.unmodifiableList(vertices_);
        }
        if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
          holes_ = java.util.Collections.unmodifiableList(holes_);
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.bwapi.proxy.messages.TerrainMessages.internal_static_messages_Polygon_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.bwapi.proxy.messages.TerrainMessages.internal_static_messages_Polygon_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.bwapi.proxy.messages.TerrainMessages.Polygon.class, org.bwapi.proxy.messages.TerrainMessages.Polygon.Builder.class);
    }

    public static com.google.protobuf.Parser<Polygon> PARSER =
        new com.google.protobuf.AbstractParser<Polygon>() {
      public Polygon parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return new Polygon(input, extensionRegistry);
      }
    };

    @java.lang.Override
    public com.google.protobuf.Parser<Polygon> getParserForType() {
      return PARSER;
    }

    private int bitField0_;
    // repeated .messages.Position vertices = 1;
    public static final int VERTICES_FIELD_NUMBER = 1;
    private java.util.List<org.bwapi.proxy.messages.BasicTypes.Position> vertices_;
    /**
     * <code>repeated .messages.Position vertices = 1;</code>
     */
    public java.util.List<org.bwapi.proxy.messages.BasicTypes.Position> getVerticesList() {
      return vertices_;
    }
    /**
     * <code>repeated .messages.Position vertices = 1;</code>
     */
    public java.util.List<? extends org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder> 
        getVerticesOrBuilderList() {
      return vertices_;
    }
    /**
     * <code>repeated .messages.Position vertices = 1;</code>
     */
    public int getVerticesCount() {
      return vertices_.size();
    }
    /**
     * <code>repeated .messages.Position vertices = 1;</code>
     */
    public org.bwapi.proxy.messages.BasicTypes.Position getVertices(int index) {
      return vertices_.get(index);
    }
    /**
     * <code>repeated .messages.Position vertices = 1;</code>
     */
    public org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder getVerticesOrBuilder(
        int index) {
      return vertices_.get(index);
    }

    // required double area = 2;
    public static final int AREA_FIELD_NUMBER = 2;
    private double area_;
    /**
     * <code>required double area = 2;</code>
     */
    public boolean hasArea() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>required double area = 2;</code>
     */
    public double getArea() {
      return area_;
    }

    // required double perimeter = 3;
    public static final int PERIMETER_FIELD_NUMBER = 3;
    private double perimeter_;
    /**
     * <code>required double perimeter = 3;</code>
     */
    public boolean hasPerimeter() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>required double perimeter = 3;</code>
     */
    public double getPerimeter() {
      return perimeter_;
    }

    // required .messages.Position center = 4;
    public static final int CENTER_FIELD_NUMBER = 4;
    private org.bwapi.proxy.messages.BasicTypes.Position center_;
    /**
     * <code>required .messages.Position center = 4;</code>
     */
    public boolean hasCenter() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>required .messages.Position center = 4;</code>
     */
    public org.bwapi.proxy.messages.BasicTypes.Position getCenter() {
      return center_;
    }
    /**
     * <code>required .messages.Position center = 4;</code>
     */
    public org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder getCenterOrBuilder() {
      return center_;
    }

    // repeated .messages.Polygon holes = 5;
    public static final int HOLES_FIELD_NUMBER = 5;
    private java.util.List<org.bwapi.proxy.messages.TerrainMessages.Polygon> holes_;
    /**
     * <code>repeated .messages.Polygon holes = 5;</code>
     *
     * <pre>
     *bool isInside(BWAPI::Position p) const;
     *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
     * </pre>
     */
    public java.util.List<org.bwapi.proxy.messages.TerrainMessages.Polygon> getHolesList() {
      return holes_;
    }
    /**
     * <code>repeated .messages.Polygon holes = 5;</code>
     *
     * <pre>
     *bool isInside(BWAPI::Position p) const;
     *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
     * </pre>
     */
    public java.util.List<? extends org.bwapi.proxy.messages.TerrainMessages.PolygonOrBuilder> 
        getHolesOrBuilderList() {
      return holes_;
    }
    /**
     * <code>repeated .messages.Polygon holes = 5;</code>
     *
     * <pre>
     *bool isInside(BWAPI::Position p) const;
     *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
     * </pre>
     */
    public int getHolesCount() {
      return holes_.size();
    }
    /**
     * <code>repeated .messages.Polygon holes = 5;</code>
     *
     * <pre>
     *bool isInside(BWAPI::Position p) const;
     *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
     * </pre>
     */
    public org.bwapi.proxy.messages.TerrainMessages.Polygon getHoles(int index) {
      return holes_.get(index);
    }
    /**
     * <code>repeated .messages.Polygon holes = 5;</code>
     *
     * <pre>
     *bool isInside(BWAPI::Position p) const;
     *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
     * </pre>
     */
    public org.bwapi.proxy.messages.TerrainMessages.PolygonOrBuilder getHolesOrBuilder(
        int index) {
      return holes_.get(index);
    }

    private void initFields() {
      vertices_ = java.util.Collections.emptyList();
      area_ = 0D;
      perimeter_ = 0D;
      center_ = org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance();
      holes_ = java.util.Collections.emptyList();
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      if (!hasArea()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!hasPerimeter()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!hasCenter()) {
        memoizedIsInitialized = 0;
        return false;
      }
      for (int i = 0; i < getVerticesCount(); i++) {
        if (!getVertices(i).isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      if (!getCenter().isInitialized()) {
        memoizedIsInitialized = 0;
        return false;
      }
      for (int i = 0; i < getHolesCount(); i++) {
        if (!getHoles(i).isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      for (int i = 0; i < vertices_.size(); i++) {
        output.writeMessage(1, vertices_.get(i));
      }
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeDouble(2, area_);
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeDouble(3, perimeter_);
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeMessage(4, center_);
      }
      for (int i = 0; i < holes_.size(); i++) {
        output.writeMessage(5, holes_.get(i));
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      for (int i = 0; i < vertices_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(1, vertices_.get(i));
      }
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeDoubleSize(2, area_);
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeDoubleSize(3, perimeter_);
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(4, center_);
      }
      for (int i = 0; i < holes_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(5, holes_.get(i));
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static org.bwapi.proxy.messages.TerrainMessages.Polygon parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Polygon parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Polygon parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Polygon parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Polygon parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Polygon parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Polygon parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Polygon parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Polygon parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Polygon parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(org.bwapi.proxy.messages.TerrainMessages.Polygon prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code messages.Polygon}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements org.bwapi.proxy.messages.TerrainMessages.PolygonOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return org.bwapi.proxy.messages.TerrainMessages.internal_static_messages_Polygon_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return org.bwapi.proxy.messages.TerrainMessages.internal_static_messages_Polygon_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                org.bwapi.proxy.messages.TerrainMessages.Polygon.class, org.bwapi.proxy.messages.TerrainMessages.Polygon.Builder.class);
      }

      // Construct using org.bwapi.proxy.messages.TerrainMessages.Polygon.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          getVerticesFieldBuilder();
          getCenterFieldBuilder();
          getHolesFieldBuilder();
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        if (verticesBuilder_ == null) {
          vertices_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000001);
        } else {
          verticesBuilder_.clear();
        }
        area_ = 0D;
        bitField0_ = (bitField0_ & ~0x00000002);
        perimeter_ = 0D;
        bitField0_ = (bitField0_ & ~0x00000004);
        if (centerBuilder_ == null) {
          center_ = org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance();
        } else {
          centerBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000008);
        if (holesBuilder_ == null) {
          holes_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000010);
        } else {
          holesBuilder_.clear();
        }
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return org.bwapi.proxy.messages.TerrainMessages.internal_static_messages_Polygon_descriptor;
      }

      public org.bwapi.proxy.messages.TerrainMessages.Polygon getDefaultInstanceForType() {
        return org.bwapi.proxy.messages.TerrainMessages.Polygon.getDefaultInstance();
      }

      public org.bwapi.proxy.messages.TerrainMessages.Polygon build() {
        org.bwapi.proxy.messages.TerrainMessages.Polygon result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public org.bwapi.proxy.messages.TerrainMessages.Polygon buildPartial() {
        org.bwapi.proxy.messages.TerrainMessages.Polygon result = new org.bwapi.proxy.messages.TerrainMessages.Polygon(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (verticesBuilder_ == null) {
          if (((bitField0_ & 0x00000001) == 0x00000001)) {
            vertices_ = java.util.Collections.unmodifiableList(vertices_);
            bitField0_ = (bitField0_ & ~0x00000001);
          }
          result.vertices_ = vertices_;
        } else {
          result.vertices_ = verticesBuilder_.build();
        }
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000001;
        }
        result.area_ = area_;
        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
          to_bitField0_ |= 0x00000002;
        }
        result.perimeter_ = perimeter_;
        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
          to_bitField0_ |= 0x00000004;
        }
        if (centerBuilder_ == null) {
          result.center_ = center_;
        } else {
          result.center_ = centerBuilder_.build();
        }
        if (holesBuilder_ == null) {
          if (((bitField0_ & 0x00000010) == 0x00000010)) {
            holes_ = java.util.Collections.unmodifiableList(holes_);
            bitField0_ = (bitField0_ & ~0x00000010);
          }
          result.holes_ = holes_;
        } else {
          result.holes_ = holesBuilder_.build();
        }
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof org.bwapi.proxy.messages.TerrainMessages.Polygon) {
          return mergeFrom((org.bwapi.proxy.messages.TerrainMessages.Polygon)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(org.bwapi.proxy.messages.TerrainMessages.Polygon other) {
        if (other == org.bwapi.proxy.messages.TerrainMessages.Polygon.getDefaultInstance()) return this;
        if (verticesBuilder_ == null) {
          if (!other.vertices_.isEmpty()) {
            if (vertices_.isEmpty()) {
              vertices_ = other.vertices_;
              bitField0_ = (bitField0_ & ~0x00000001);
            } else {
              ensureVerticesIsMutable();
              vertices_.addAll(other.vertices_);
            }
            onChanged();
          }
        } else {
          if (!other.vertices_.isEmpty()) {
            if (verticesBuilder_.isEmpty()) {
              verticesBuilder_.dispose();
              verticesBuilder_ = null;
              vertices_ = other.vertices_;
              bitField0_ = (bitField0_ & ~0x00000001);
              verticesBuilder_ = 
                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                   getVerticesFieldBuilder() : null;
            } else {
              verticesBuilder_.addAllMessages(other.vertices_);
            }
          }
        }
        if (other.hasArea()) {
          setArea(other.getArea());
        }
        if (other.hasPerimeter()) {
          setPerimeter(other.getPerimeter());
        }
        if (other.hasCenter()) {
          mergeCenter(other.getCenter());
        }
        if (holesBuilder_ == null) {
          if (!other.holes_.isEmpty()) {
            if (holes_.isEmpty()) {
              holes_ = other.holes_;
              bitField0_ = (bitField0_ & ~0x00000010);
            } else {
              ensureHolesIsMutable();
              holes_.addAll(other.holes_);
            }
            onChanged();
          }
        } else {
          if (!other.holes_.isEmpty()) {
            if (holesBuilder_.isEmpty()) {
              holesBuilder_.dispose();
              holesBuilder_ = null;
              holes_ = other.holes_;
              bitField0_ = (bitField0_ & ~0x00000010);
              holesBuilder_ = 
                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                   getHolesFieldBuilder() : null;
            } else {
              holesBuilder_.addAllMessages(other.holes_);
            }
          }
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        if (!hasArea()) {
          
          return false;
        }
        if (!hasPerimeter()) {
          
          return false;
        }
        if (!hasCenter()) {
          
          return false;
        }
        for (int i = 0; i < getVerticesCount(); i++) {
          if (!getVertices(i).isInitialized()) {
            
            return false;
          }
        }
        if (!getCenter().isInitialized()) {
          
          return false;
        }
        for (int i = 0; i < getHolesCount(); i++) {
          if (!getHoles(i).isInitialized()) {
            
            return false;
          }
        }
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        org.bwapi.proxy.messages.TerrainMessages.Polygon parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (org.bwapi.proxy.messages.TerrainMessages.Polygon) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // repeated .messages.Position vertices = 1;
      private java.util.List<org.bwapi.proxy.messages.BasicTypes.Position> vertices_ =
        java.util.Collections.emptyList();
      private void ensureVerticesIsMutable() {
        if (!((bitField0_ & 0x00000001) == 0x00000001)) {
          vertices_ = new java.util.ArrayList<org.bwapi.proxy.messages.BasicTypes.Position>(vertices_);
          bitField0_ |= 0x00000001;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilder<
          org.bwapi.proxy.messages.BasicTypes.Position, org.bwapi.proxy.messages.BasicTypes.Position.Builder, org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder> verticesBuilder_;

      /**
       * <code>repeated .messages.Position vertices = 1;</code>
       */
      public java.util.List<org.bwapi.proxy.messages.BasicTypes.Position> getVerticesList() {
        if (verticesBuilder_ == null) {
          return java.util.Collections.unmodifiableList(vertices_);
        } else {
          return verticesBuilder_.getMessageList();
        }
      }
      /**
       * <code>repeated .messages.Position vertices = 1;</code>
       */
      public int getVerticesCount() {
        if (verticesBuilder_ == null) {
          return vertices_.size();
        } else {
          return verticesBuilder_.getCount();
        }
      }
      /**
       * <code>repeated .messages.Position vertices = 1;</code>
       */
      public org.bwapi.proxy.messages.BasicTypes.Position getVertices(int index) {
        if (verticesBuilder_ == null) {
          return vertices_.get(index);
        } else {
          return verticesBuilder_.getMessage(index);
        }
      }
      /**
       * <code>repeated .messages.Position vertices = 1;</code>
       */
      public Builder setVertices(
          int index, org.bwapi.proxy.messages.BasicTypes.Position value) {
        if (verticesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureVerticesIsMutable();
          vertices_.set(index, value);
          onChanged();
        } else {
          verticesBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .messages.Position vertices = 1;</code>
       */
      public Builder setVertices(
          int index, org.bwapi.proxy.messages.BasicTypes.Position.Builder builderForValue) {
        if (verticesBuilder_ == null) {
          ensureVerticesIsMutable();
          vertices_.set(index, builderForValue.build());
          onChanged();
        } else {
          verticesBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .messages.Position vertices = 1;</code>
       */
      public Builder addVertices(org.bwapi.proxy.messages.BasicTypes.Position value) {
        if (verticesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureVerticesIsMutable();
          vertices_.add(value);
          onChanged();
        } else {
          verticesBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <code>repeated .messages.Position vertices = 1;</code>
       */
      public Builder addVertices(
          int index, org.bwapi.proxy.messages.BasicTypes.Position value) {
        if (verticesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureVerticesIsMutable();
          vertices_.add(index, value);
          onChanged();
        } else {
          verticesBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .messages.Position vertices = 1;</code>
       */
      public Builder addVertices(
          org.bwapi.proxy.messages.BasicTypes.Position.Builder builderForValue) {
        if (verticesBuilder_ == null) {
          ensureVerticesIsMutable();
          vertices_.add(builderForValue.build());
          onChanged();
        } else {
          verticesBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .messages.Position vertices = 1;</code>
       */
      public Builder addVertices(
          int index, org.bwapi.proxy.messages.BasicTypes.Position.Builder builderForValue) {
        if (verticesBuilder_ == null) {
          ensureVerticesIsMutable();
          vertices_.add(index, builderForValue.build());
          onChanged();
        } else {
          verticesBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .messages.Position vertices = 1;</code>
       */
      public Builder addAllVertices(
          java.lang.Iterable<? extends org.bwapi.proxy.messages.BasicTypes.Position> values) {
        if (verticesBuilder_ == null) {
          ensureVerticesIsMutable();
          super.addAll(values, vertices_);
          onChanged();
        } else {
          verticesBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <code>repeated .messages.Position vertices = 1;</code>
       */
      public Builder clearVertices() {
        if (verticesBuilder_ == null) {
          vertices_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000001);
          onChanged();
        } else {
          verticesBuilder_.clear();
        }
        return this;
      }
      /**
       * <code>repeated .messages.Position vertices = 1;</code>
       */
      public Builder removeVertices(int index) {
        if (verticesBuilder_ == null) {
          ensureVerticesIsMutable();
          vertices_.remove(index);
          onChanged();
        } else {
          verticesBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <code>repeated .messages.Position vertices = 1;</code>
       */
      public org.bwapi.proxy.messages.BasicTypes.Position.Builder getVerticesBuilder(
          int index) {
        return getVerticesFieldBuilder().getBuilder(index);
      }
      /**
       * <code>repeated .messages.Position vertices = 1;</code>
       */
      public org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder getVerticesOrBuilder(
          int index) {
        if (verticesBuilder_ == null) {
          return vertices_.get(index);  } else {
          return verticesBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <code>repeated .messages.Position vertices = 1;</code>
       */
      public java.util.List<? extends org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder> 
           getVerticesOrBuilderList() {
        if (verticesBuilder_ != null) {
          return verticesBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(vertices_);
        }
      }
      /**
       * <code>repeated .messages.Position vertices = 1;</code>
       */
      public org.bwapi.proxy.messages.BasicTypes.Position.Builder addVerticesBuilder() {
        return getVerticesFieldBuilder().addBuilder(
            org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance());
      }
      /**
       * <code>repeated .messages.Position vertices = 1;</code>
       */
      public org.bwapi.proxy.messages.BasicTypes.Position.Builder addVerticesBuilder(
          int index) {
        return getVerticesFieldBuilder().addBuilder(
            index, org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance());
      }
      /**
       * <code>repeated .messages.Position vertices = 1;</code>
       */
      public java.util.List<org.bwapi.proxy.messages.BasicTypes.Position.Builder> 
           getVerticesBuilderList() {
        return getVerticesFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilder<
          org.bwapi.proxy.messages.BasicTypes.Position, org.bwapi.proxy.messages.BasicTypes.Position.Builder, org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder> 
          getVerticesFieldBuilder() {
        if (verticesBuilder_ == null) {
          verticesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
              org.bwapi.proxy.messages.BasicTypes.Position, org.bwapi.proxy.messages.BasicTypes.Position.Builder, org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder>(
                  vertices_,
                  ((bitField0_ & 0x00000001) == 0x00000001),
                  getParentForChildren(),
                  isClean());
          vertices_ = null;
        }
        return verticesBuilder_;
      }

      // required double area = 2;
      private double area_ ;
      /**
       * <code>required double area = 2;</code>
       */
      public boolean hasArea() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      /**
       * <code>required double area = 2;</code>
       */
      public double getArea() {
        return area_;
      }
      /**
       * <code>required double area = 2;</code>
       */
      public Builder setArea(double value) {
        bitField0_ |= 0x00000002;
        area_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>required double area = 2;</code>
       */
      public Builder clearArea() {
        bitField0_ = (bitField0_ & ~0x00000002);
        area_ = 0D;
        onChanged();
        return this;
      }

      // required double perimeter = 3;
      private double perimeter_ ;
      /**
       * <code>required double perimeter = 3;</code>
       */
      public boolean hasPerimeter() {
        return ((bitField0_ & 0x00000004) == 0x00000004);
      }
      /**
       * <code>required double perimeter = 3;</code>
       */
      public double getPerimeter() {
        return perimeter_;
      }
      /**
       * <code>required double perimeter = 3;</code>
       */
      public Builder setPerimeter(double value) {
        bitField0_ |= 0x00000004;
        perimeter_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>required double perimeter = 3;</code>
       */
      public Builder clearPerimeter() {
        bitField0_ = (bitField0_ & ~0x00000004);
        perimeter_ = 0D;
        onChanged();
        return this;
      }

      // required .messages.Position center = 4;
      private org.bwapi.proxy.messages.BasicTypes.Position center_ = org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance();
      private com.google.protobuf.SingleFieldBuilder<
          org.bwapi.proxy.messages.BasicTypes.Position, org.bwapi.proxy.messages.BasicTypes.Position.Builder, org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder> centerBuilder_;
      /**
       * <code>required .messages.Position center = 4;</code>
       */
      public boolean hasCenter() {
        return ((bitField0_ & 0x00000008) == 0x00000008);
      }
      /**
       * <code>required .messages.Position center = 4;</code>
       */
      public org.bwapi.proxy.messages.BasicTypes.Position getCenter() {
        if (centerBuilder_ == null) {
          return center_;
        } else {
          return centerBuilder_.getMessage();
        }
      }
      /**
       * <code>required .messages.Position center = 4;</code>
       */
      public Builder setCenter(org.bwapi.proxy.messages.BasicTypes.Position value) {
        if (centerBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          center_ = value;
          onChanged();
        } else {
          centerBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000008;
        return this;
      }
      /**
       * <code>required .messages.Position center = 4;</code>
       */
      public Builder setCenter(
          org.bwapi.proxy.messages.BasicTypes.Position.Builder builderForValue) {
        if (centerBuilder_ == null) {
          center_ = builderForValue.build();
          onChanged();
        } else {
          centerBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000008;
        return this;
      }
      /**
       * <code>required .messages.Position center = 4;</code>
       */
      public Builder mergeCenter(org.bwapi.proxy.messages.BasicTypes.Position value) {
        if (centerBuilder_ == null) {
          if (((bitField0_ & 0x00000008) == 0x00000008) &&
              center_ != org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance()) {
            center_ =
              org.bwapi.proxy.messages.BasicTypes.Position.newBuilder(center_).mergeFrom(value).buildPartial();
          } else {
            center_ = value;
          }
          onChanged();
        } else {
          centerBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000008;
        return this;
      }
      /**
       * <code>required .messages.Position center = 4;</code>
       */
      public Builder clearCenter() {
        if (centerBuilder_ == null) {
          center_ = org.bwapi.proxy.messages.BasicTypes.Position.getDefaultInstance();
          onChanged();
        } else {
          centerBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000008);
        return this;
      }
      /**
       * <code>required .messages.Position center = 4;</code>
       */
      public org.bwapi.proxy.messages.BasicTypes.Position.Builder getCenterBuilder() {
        bitField0_ |= 0x00000008;
        onChanged();
        return getCenterFieldBuilder().getBuilder();
      }
      /**
       * <code>required .messages.Position center = 4;</code>
       */
      public org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder getCenterOrBuilder() {
        if (centerBuilder_ != null) {
          return centerBuilder_.getMessageOrBuilder();
        } else {
          return center_;
        }
      }
      /**
       * <code>required .messages.Position center = 4;</code>
       */
      private com.google.protobuf.SingleFieldBuilder<
          org.bwapi.proxy.messages.BasicTypes.Position, org.bwapi.proxy.messages.BasicTypes.Position.Builder, org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder> 
          getCenterFieldBuilder() {
        if (centerBuilder_ == null) {
          centerBuilder_ = new com.google.protobuf.SingleFieldBuilder<
              org.bwapi.proxy.messages.BasicTypes.Position, org.bwapi.proxy.messages.BasicTypes.Position.Builder, org.bwapi.proxy.messages.BasicTypes.PositionOrBuilder>(
                  center_,
                  getParentForChildren(),
                  isClean());
          center_ = null;
        }
        return centerBuilder_;
      }

      // repeated .messages.Polygon holes = 5;
      private java.util.List<org.bwapi.proxy.messages.TerrainMessages.Polygon> holes_ =
        java.util.Collections.emptyList();
      private void ensureHolesIsMutable() {
        if (!((bitField0_ & 0x00000010) == 0x00000010)) {
          holes_ = new java.util.ArrayList<org.bwapi.proxy.messages.TerrainMessages.Polygon>(holes_);
          bitField0_ |= 0x00000010;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilder<
          org.bwapi.proxy.messages.TerrainMessages.Polygon, org.bwapi.proxy.messages.TerrainMessages.Polygon.Builder, org.bwapi.proxy.messages.TerrainMessages.PolygonOrBuilder> holesBuilder_;

      /**
       * <code>repeated .messages.Polygon holes = 5;</code>
       *
       * <pre>
       *bool isInside(BWAPI::Position p) const;
       *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
       * </pre>
       */
      public java.util.List<org.bwapi.proxy.messages.TerrainMessages.Polygon> getHolesList() {
        if (holesBuilder_ == null) {
          return java.util.Collections.unmodifiableList(holes_);
        } else {
          return holesBuilder_.getMessageList();
        }
      }
      /**
       * <code>repeated .messages.Polygon holes = 5;</code>
       *
       * <pre>
       *bool isInside(BWAPI::Position p) const;
       *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
       * </pre>
       */
      public int getHolesCount() {
        if (holesBuilder_ == null) {
          return holes_.size();
        } else {
          return holesBuilder_.getCount();
        }
      }
      /**
       * <code>repeated .messages.Polygon holes = 5;</code>
       *
       * <pre>
       *bool isInside(BWAPI::Position p) const;
       *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
       * </pre>
       */
      public org.bwapi.proxy.messages.TerrainMessages.Polygon getHoles(int index) {
        if (holesBuilder_ == null) {
          return holes_.get(index);
        } else {
          return holesBuilder_.getMessage(index);
        }
      }
      /**
       * <code>repeated .messages.Polygon holes = 5;</code>
       *
       * <pre>
       *bool isInside(BWAPI::Position p) const;
       *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
       * </pre>
       */
      public Builder setHoles(
          int index, org.bwapi.proxy.messages.TerrainMessages.Polygon value) {
        if (holesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureHolesIsMutable();
          holes_.set(index, value);
          onChanged();
        } else {
          holesBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .messages.Polygon holes = 5;</code>
       *
       * <pre>
       *bool isInside(BWAPI::Position p) const;
       *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
       * </pre>
       */
      public Builder setHoles(
          int index, org.bwapi.proxy.messages.TerrainMessages.Polygon.Builder builderForValue) {
        if (holesBuilder_ == null) {
          ensureHolesIsMutable();
          holes_.set(index, builderForValue.build());
          onChanged();
        } else {
          holesBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .messages.Polygon holes = 5;</code>
       *
       * <pre>
       *bool isInside(BWAPI::Position p) const;
       *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
       * </pre>
       */
      public Builder addHoles(org.bwapi.proxy.messages.TerrainMessages.Polygon value) {
        if (holesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureHolesIsMutable();
          holes_.add(value);
          onChanged();
        } else {
          holesBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <code>repeated .messages.Polygon holes = 5;</code>
       *
       * <pre>
       *bool isInside(BWAPI::Position p) const;
       *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
       * </pre>
       */
      public Builder addHoles(
          int index, org.bwapi.proxy.messages.TerrainMessages.Polygon value) {
        if (holesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureHolesIsMutable();
          holes_.add(index, value);
          onChanged();
        } else {
          holesBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .messages.Polygon holes = 5;</code>
       *
       * <pre>
       *bool isInside(BWAPI::Position p) const;
       *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
       * </pre>
       */
      public Builder addHoles(
          org.bwapi.proxy.messages.TerrainMessages.Polygon.Builder builderForValue) {
        if (holesBuilder_ == null) {
          ensureHolesIsMutable();
          holes_.add(builderForValue.build());
          onChanged();
        } else {
          holesBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .messages.Polygon holes = 5;</code>
       *
       * <pre>
       *bool isInside(BWAPI::Position p) const;
       *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
       * </pre>
       */
      public Builder addHoles(
          int index, org.bwapi.proxy.messages.TerrainMessages.Polygon.Builder builderForValue) {
        if (holesBuilder_ == null) {
          ensureHolesIsMutable();
          holes_.add(index, builderForValue.build());
          onChanged();
        } else {
          holesBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .messages.Polygon holes = 5;</code>
       *
       * <pre>
       *bool isInside(BWAPI::Position p) const;
       *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
       * </pre>
       */
      public Builder addAllHoles(
          java.lang.Iterable<? extends org.bwapi.proxy.messages.TerrainMessages.Polygon> values) {
        if (holesBuilder_ == null) {
          ensureHolesIsMutable();
          super.addAll(values, holes_);
          onChanged();
        } else {
          holesBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <code>repeated .messages.Polygon holes = 5;</code>
       *
       * <pre>
       *bool isInside(BWAPI::Position p) const;
       *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
       * </pre>
       */
      public Builder clearHoles() {
        if (holesBuilder_ == null) {
          holes_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000010);
          onChanged();
        } else {
          holesBuilder_.clear();
        }
        return this;
      }
      /**
       * <code>repeated .messages.Polygon holes = 5;</code>
       *
       * <pre>
       *bool isInside(BWAPI::Position p) const;
       *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
       * </pre>
       */
      public Builder removeHoles(int index) {
        if (holesBuilder_ == null) {
          ensureHolesIsMutable();
          holes_.remove(index);
          onChanged();
        } else {
          holesBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <code>repeated .messages.Polygon holes = 5;</code>
       *
       * <pre>
       *bool isInside(BWAPI::Position p) const;
       *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
       * </pre>
       */
      public org.bwapi.proxy.messages.TerrainMessages.Polygon.Builder getHolesBuilder(
          int index) {
        return getHolesFieldBuilder().getBuilder(index);
      }
      /**
       * <code>repeated .messages.Polygon holes = 5;</code>
       *
       * <pre>
       *bool isInside(BWAPI::Position p) const;
       *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
       * </pre>
       */
      public org.bwapi.proxy.messages.TerrainMessages.PolygonOrBuilder getHolesOrBuilder(
          int index) {
        if (holesBuilder_ == null) {
          return holes_.get(index);  } else {
          return holesBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <code>repeated .messages.Polygon holes = 5;</code>
       *
       * <pre>
       *bool isInside(BWAPI::Position p) const;
       *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
       * </pre>
       */
      public java.util.List<? extends org.bwapi.proxy.messages.TerrainMessages.PolygonOrBuilder> 
           getHolesOrBuilderList() {
        if (holesBuilder_ != null) {
          return holesBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(holes_);
        }
      }
      /**
       * <code>repeated .messages.Polygon holes = 5;</code>
       *
       * <pre>
       *bool isInside(BWAPI::Position p) const;
       *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
       * </pre>
       */
      public org.bwapi.proxy.messages.TerrainMessages.Polygon.Builder addHolesBuilder() {
        return getHolesFieldBuilder().addBuilder(
            org.bwapi.proxy.messages.TerrainMessages.Polygon.getDefaultInstance());
      }
      /**
       * <code>repeated .messages.Polygon holes = 5;</code>
       *
       * <pre>
       *bool isInside(BWAPI::Position p) const;
       *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
       * </pre>
       */
      public org.bwapi.proxy.messages.TerrainMessages.Polygon.Builder addHolesBuilder(
          int index) {
        return getHolesFieldBuilder().addBuilder(
            index, org.bwapi.proxy.messages.TerrainMessages.Polygon.getDefaultInstance());
      }
      /**
       * <code>repeated .messages.Polygon holes = 5;</code>
       *
       * <pre>
       *bool isInside(BWAPI::Position p) const;
       *BWAPI::Position getNearestPoint(BWAPI::Position p) const;
       * </pre>
       */
      public java.util.List<org.bwapi.proxy.messages.TerrainMessages.Polygon.Builder> 
           getHolesBuilderList() {
        return getHolesFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilder<
          org.bwapi.proxy.messages.TerrainMessages.Polygon, org.bwapi.proxy.messages.TerrainMessages.Polygon.Builder, org.bwapi.proxy.messages.TerrainMessages.PolygonOrBuilder> 
          getHolesFieldBuilder() {
        if (holesBuilder_ == null) {
          holesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
              org.bwapi.proxy.messages.TerrainMessages.Polygon, org.bwapi.proxy.messages.TerrainMessages.Polygon.Builder, org.bwapi.proxy.messages.TerrainMessages.PolygonOrBuilder>(
                  holes_,
                  ((bitField0_ & 0x00000010) == 0x00000010),
                  getParentForChildren(),
                  isClean());
          holes_ = null;
        }
        return holesBuilder_;
      }

      // @@protoc_insertion_point(builder_scope:messages.Polygon)
    }

    static {
      defaultInstance = new Polygon(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:messages.Polygon)
  }

  public interface RegionOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // required int32 id = 1;
    /**
     * <code>required int32 id = 1;</code>
     */
    boolean hasId();
    /**
     * <code>required int32 id = 1;</code>
     */
    int getId();

    // required .messages.Polygon polygon = 2;
    /**
     * <code>required .messages.Polygon polygon = 2;</code>
     */
    boolean hasPolygon();
    /**
     * <code>required .messages.Polygon polygon = 2;</code>
     */
    org.bwapi.proxy.messages.TerrainMessages.Polygon getPolygon();
    /**
     * <code>required .messages.Polygon polygon = 2;</code>
     */
    org.bwapi.proxy.messages.TerrainMessages.PolygonOrBuilder getPolygonOrBuilder();

    // repeated int32 chokepoints = 3;
    /**
     * <code>repeated int32 chokepoints = 3;</code>
     */
    java.util.List<java.lang.Integer> getChokepointsList();
    /**
     * <code>repeated int32 chokepoints = 3;</code>
     */
    int getChokepointsCount();
    /**
     * <code>repeated int32 chokepoints = 3;</code>
     */
    int getChokepoints(int index);

    // repeated int32 baseLocations = 4;
    /**
     * <code>repeated int32 baseLocations = 4;</code>
     */
    java.util.List<java.lang.Integer> getBaseLocationsList();
    /**
     * <code>repeated int32 baseLocations = 4;</code>
     */
    int getBaseLocationsCount();
    /**
     * <code>repeated int32 baseLocations = 4;</code>
     */
    int getBaseLocations(int index);
  }
  /**
   * Protobuf type {@code messages.Region}
   */
  public static final class Region extends
      com.google.protobuf.GeneratedMessage
      implements RegionOrBuilder {
    // Use Region.newBuilder() to construct.
    private Region(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private Region(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final Region defaultInstance;
    public static Region getDefaultInstance() {
      return defaultInstance;
    }

    public Region getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private Region(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      int mutable_bitField0_ = 0;
      com.google.protobuf.UnknownFieldSet.Builder unknownFields =
          com.google.protobuf.UnknownFieldSet.newBuilder();
      try {
        boolean done = false;
        while (!done) {
          int tag = input.readTag();
          switch (tag) {
            case 0:
              done = true;
              break;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 8: {
              bitField0_ |= 0x00000001;
              id_ = input.readInt32();
              break;
            }
            case 18: {
              org.bwapi.proxy.messages.TerrainMessages.Polygon.Builder subBuilder = null;
              if (((bitField0_ & 0x00000002) == 0x00000002)) {
                subBuilder = polygon_.toBuilder();
              }
              polygon_ = input.readMessage(org.bwapi.proxy.messages.TerrainMessages.Polygon.PARSER, extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(polygon_);
                polygon_ = subBuilder.buildPartial();
              }
              bitField0_ |= 0x00000002;
              break;
            }
            case 24: {
              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
                chokepoints_ = new java.util.ArrayList<java.lang.Integer>();
                mutable_bitField0_ |= 0x00000004;
              }
              chokepoints_.add(input.readInt32());
              break;
            }
            case 26: {
              int length = input.readRawVarint32();
              int limit = input.pushLimit(length);
              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004) && input.getBytesUntilLimit() > 0) {
                chokepoints_ = new java.util.ArrayList<java.lang.Integer>();
                mutable_bitField0_ |= 0x00000004;
              }
              while (input.getBytesUntilLimit() > 0) {
                chokepoints_.add(input.readInt32());
              }
              input.popLimit(limit);
              break;
            }
            case 32: {
              if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
                baseLocations_ = new java.util.ArrayList<java.lang.Integer>();
                mutable_bitField0_ |= 0x00000008;
              }
              baseLocations_.add(input.readInt32());
              break;
            }
            case 34: {
              int length = input.readRawVarint32();
              int limit = input.pushLimit(length);
              if (!((mutable_bitField0_ & 0x00000008) == 0x00000008) && input.getBytesUntilLimit() > 0) {
                baseLocations_ = new java.util.ArrayList<java.lang.Integer>();
                mutable_bitField0_ |= 0x00000008;
              }
              while (input.getBytesUntilLimit() > 0) {
                baseLocations_.add(input.readInt32());
              }
              input.popLimit(limit);
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
          chokepoints_ = java.util.Collections.unmodifiableList(chokepoints_);
        }
        if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
          baseLocations_ = java.util.Collections.unmodifiableList(baseLocations_);
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return org.bwapi.proxy.messages.TerrainMessages.internal_static_messages_Region_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return org.bwapi.proxy.messages.TerrainMessages.internal_static_messages_Region_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              org.bwapi.proxy.messages.TerrainMessages.Region.class, org.bwapi.proxy.messages.TerrainMessages.Region.Builder.class);
    }

    public static com.google.protobuf.Parser<Region> PARSER =
        new com.google.protobuf.AbstractParser<Region>() {
      public Region parsePartialFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return new Region(input, extensionRegistry);
      }
    };

    @java.lang.Override
    public com.google.protobuf.Parser<Region> getParserForType() {
      return PARSER;
    }

    private int bitField0_;
    // required int32 id = 1;
    public static final int ID_FIELD_NUMBER = 1;
    private int id_;
    /**
     * <code>required int32 id = 1;</code>
     */
    public boolean hasId() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>required int32 id = 1;</code>
     */
    public int getId() {
      return id_;
    }

    // required .messages.Polygon polygon = 2;
    public static final int POLYGON_FIELD_NUMBER = 2;
    private org.bwapi.proxy.messages.TerrainMessages.Polygon polygon_;
    /**
     * <code>required .messages.Polygon polygon = 2;</code>
     */
    public boolean hasPolygon() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>required .messages.Polygon polygon = 2;</code>
     */
    public org.bwapi.proxy.messages.TerrainMessages.Polygon getPolygon() {
      return polygon_;
    }
    /**
     * <code>required .messages.Polygon polygon = 2;</code>
     */
    public org.bwapi.proxy.messages.TerrainMessages.PolygonOrBuilder getPolygonOrBuilder() {
      return polygon_;
    }

    // repeated int32 chokepoints = 3;
    public static final int CHOKEPOINTS_FIELD_NUMBER = 3;
    private java.util.List<java.lang.Integer> chokepoints_;
    /**
     * <code>repeated int32 chokepoints = 3;</code>
     */
    public java.util.List<java.lang.Integer>
        getChokepointsList() {
      return chokepoints_;
    }
    /**
     * <code>repeated int32 chokepoints = 3;</code>
     */
    public int getChokepointsCount() {
      return chokepoints_.size();
    }
    /**
     * <code>repeated int32 chokepoints = 3;</code>
     */
    public int getChokepoints(int index) {
      return chokepoints_.get(index);
    }

    // repeated int32 baseLocations = 4;
    public static final int BASELOCATIONS_FIELD_NUMBER = 4;
    private java.util.List<java.lang.Integer> baseLocations_;
    /**
     * <code>repeated int32 baseLocations = 4;</code>
     */
    public java.util.List<java.lang.Integer>
        getBaseLocationsList() {
      return baseLocations_;
    }
    /**
     * <code>repeated int32 baseLocations = 4;</code>
     */
    public int getBaseLocationsCount() {
      return baseLocations_.size();
    }
    /**
     * <code>repeated int32 baseLocations = 4;</code>
     */
    public int getBaseLocations(int index) {
      return baseLocations_.get(index);
    }

    private void initFields() {
      id_ = 0;
      polygon_ = org.bwapi.proxy.messages.TerrainMessages.Polygon.getDefaultInstance();
      chokepoints_ = java.util.Collections.emptyList();
      baseLocations_ = java.util.Collections.emptyList();
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      if (!hasId()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!hasPolygon()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!getPolygon().isInitialized()) {
        memoizedIsInitialized = 0;
        return false;
      }
      memoizedIsInitialized = 1;
      return true;
    }

    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.writeMessage(2, polygon_);
      }
      for (int i = 0; i < chokepoints_.size(); i++) {
        output.writeInt32(3, chokepoints_.get(i));
      }
      for (int i = 0; i < baseLocations_.size(); i++) {
        output.writeInt32(4, baseLocations_.get(i));
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(1, id_);
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(2, polygon_);
      }
      {
        int dataSize = 0;
        for (int i = 0; i < chokepoints_.size(); i++) {
          dataSize += com.google.protobuf.CodedOutputStream
            .computeInt32SizeNoTag(chokepoints_.get(i));
        }
        size += dataSize;
        size += 1 * getChokepointsList().size();
      }
      {
        int dataSize = 0;
        for (int i = 0; i < baseLocations_.size(); i++) {
          dataSize += com.google.protobuf.CodedOutputStream
            .computeInt32SizeNoTag(baseLocations_.get(i));
        }
        size += dataSize;
        size += 1 * getBaseLocationsList().size();
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static org.bwapi.proxy.messages.TerrainMessages.Region parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Region parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Region parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Region parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Region parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Region parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Region parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Region parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Region parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static org.bwapi.proxy.messages.TerrainMessages.Region parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(org.bwapi.proxy.messages.TerrainMessages.Region prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code messages.Region}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements org.bwapi.proxy.messages.TerrainMessages.RegionOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return org.bwapi.proxy.messages.TerrainMessages.internal_static_messages_Region_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return org.bwapi.proxy.messages.TerrainMessages.internal_static_messages_Region_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                org.bwapi.proxy.messages.TerrainMessages.Region.class, org.bwapi.proxy.messages.TerrainMessages.Region.Builder.class);
      }

      // Construct using org.bwapi.proxy.messages.TerrainMessages.Region.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          getPolygonFieldBuilder();
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        id_ = 0;
        bitField0_ = (bitField0_ & ~0x00000001);
        if (polygonBuilder_ == null) {
          polygon_ = org.bwapi.proxy.messages.TerrainMessages.Polygon.getDefaultInstance();
        } else {
          polygonBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000002);
        chokepoints_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000004);
        baseLocations_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000008);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return org.bwapi.proxy.messages.TerrainMessages.internal_static_messages_Region_descriptor;
      }

      public org.bwapi.proxy.messages.TerrainMessages.Region getDefaultInstanceForType() {
        return org.bwapi.proxy.messages.TerrainMessages.Region.getDefaultInstance();
      }

      public org.bwapi.proxy.messages.TerrainMessages.Region build() {
        org.bwapi.proxy.messages.TerrainMessages.Region result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public org.bwapi.proxy.messages.TerrainMessages.Region buildPartial() {
        org.bwapi.proxy.messages.TerrainMessages.Region result = new org.bwapi.proxy.messages.TerrainMessages.Region(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.id_ = id_;
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        if (polygonBuilder_ == null) {
          result.polygon_ = polygon_;
        } else {
          result.polygon_ = polygonBuilder_.build();
        }
        if (((bitField0_ & 0x00000004) == 0x00000004)) {
          chokepoints_ = java.util.Collections.unmodifiableList(chokepoints_);
          bitField0_ = (bitField0_ & ~0x00000004);
        }
        result.chokepoints_ = chokepoints_;
        if (((bitField0_ & 0x00000008) == 0x00000008)) {
          baseLocations_ = java.util.Collections.unmodifiableList(baseLocations_);
          bitField0_ = (bitField0_ & ~0x00000008);
        }
        result.baseLocations_ = baseLocations_;
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof org.bwapi.proxy.messages.TerrainMessages.Region) {
          return mergeFrom((org.bwapi.proxy.messages.TerrainMessages.Region)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(org.bwapi.proxy.messages.TerrainMessages.Region other) {
        if (other == org.bwapi.proxy.messages.TerrainMessages.Region.getDefaultInstance()) return this;
        if (other.hasId()) {
          setId(other.getId());
        }
        if (other.hasPolygon()) {
          mergePolygon(other.getPolygon());
        }
        if (!other.chokepoints_.isEmpty()) {
          if (chokepoints_.isEmpty()) {
            chokepoints_ = other.chokepoints_;
            bitField0_ = (bitField0_ & ~0x00000004);
          } else {
            ensureChokepointsIsMutable();
            chokepoints_.addAll(other.chokepoints_);
          }
          onChanged();
        }
        if (!other.baseLocations_.isEmpty()) {
          if (baseLocations_.isEmpty()) {
            baseLocations_ = other.baseLocations_;
            bitField0_ = (bitField0_ & ~0x00000008);
          } else {
            ensureBaseLocationsIsMutable();
            baseLocations_.addAll(other.baseLocations_);
          }
          onChanged();
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        if (!hasId()) {
          
          return false;
        }
        if (!hasPolygon()) {
          
          return false;
        }
        if (!getPolygon().isInitialized()) {
          
          return false;
        }
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        org.bwapi.proxy.messages.TerrainMessages.Region parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (org.bwapi.proxy.messages.TerrainMessages.Region) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // required int32 id = 1;
      private int id_ ;
      /**
       * <code>required int32 id = 1;</code>
       */
      public boolean hasId() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>required int32 id = 1;</code>
       */
      public int getId() {
        return id_;
      }
      /**
       * <code>required int32 id = 1;</code>
       */
      public Builder setId(int value) {
        bitField0_ |= 0x00000001;
        id_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>required int32 id = 1;</code>
       */
      public Builder clearId() {
        bitField0_ = (bitField0_ & ~0x00000001);
        id_ = 0;
        onChanged();
        return this;
      }

      // required .messages.Polygon polygon = 2;
      private org.bwapi.proxy.messages.TerrainMessages.Polygon polygon_ = org.bwapi.proxy.messages.TerrainMessages.Polygon.getDefaultInstance();
      private com.google.protobuf.SingleFieldBuilder<
          org.bwapi.proxy.messages.TerrainMessages.Polygon, org.bwapi.proxy.messages.TerrainMessages.Polygon.Builder, org.bwapi.proxy.messages.TerrainMessages.PolygonOrBuilder> polygonBuilder_;
      /**
       * <code>required .messages.Polygon polygon = 2;</code>
       */
      public boolean hasPolygon() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      /**
       * <code>required .messages.Polygon polygon = 2;</code>
       */
      public org.bwapi.proxy.messages.TerrainMessages.Polygon getPolygon() {
        if (polygonBuilder_ == null) {
          return polygon_;
        } else {
          return polygonBuilder_.getMessage();
        }
      }
      /**
       * <code>required .messages.Polygon polygon = 2;</code>
       */
      public Builder setPolygon(org.bwapi.proxy.messages.TerrainMessages.Polygon value) {
        if (polygonBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          polygon_ = value;
          onChanged();
        } else {
          polygonBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000002;
        return this;
      }
      /**
       * <code>required .messages.Polygon polygon = 2;</code>
       */
      public Builder setPolygon(
          org.bwapi.proxy.messages.TerrainMessages.Polygon.Builder builderForValue) {
        if (polygonBuilder_ == null) {
          polygon_ = builderForValue.build();
          onChanged();
        } else {
          polygonBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000002;
        return this;
      }
      /**
       * <code>required .messages.Polygon polygon = 2;</code>
       */
      public Builder mergePolygon(org.bwapi.proxy.messages.TerrainMessages.Polygon value) {
        if (polygonBuilder_ == null) {
          if (((bitField0_ & 0x00000002) == 0x00000002) &&
              polygon_ != org.bwapi.proxy.messages.TerrainMessages.Polygon.getDefaultInstance()) {
            polygon_ =
              org.bwapi.proxy.messages.TerrainMessages.Polygon.newBuilder(polygon_).mergeFrom(value).buildPartial();
          } else {
            polygon_ = value;
          }
          onChanged();
        } else {
          polygonBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000002;
        return this;
      }
      /**
       * <code>required .messages.Polygon polygon = 2;</code>
       */
      public Builder clearPolygon() {
        if (polygonBuilder_ == null) {
          polygon_ = org.bwapi.proxy.messages.TerrainMessages.Polygon.getDefaultInstance();
          onChanged();
        } else {
          polygonBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000002);
        return this;
      }
      /**
       * <code>required .messages.Polygon polygon = 2;</code>
       */
      public org.bwapi.proxy.messages.TerrainMessages.Polygon.Builder getPolygonBuilder() {
        bitField0_ |= 0x00000002;
        onChanged();
        return getPolygonFieldBuilder().getBuilder();
      }
      /**
       * <code>required .messages.Polygon polygon = 2;</code>
       */
      public org.bwapi.proxy.messages.TerrainMessages.PolygonOrBuilder getPolygonOrBuilder() {
        if (polygonBuilder_ != null) {
          return polygonBuilder_.getMessageOrBuilder();
        } else {
          return polygon_;
        }
      }
      /**
       * <code>required .messages.Polygon polygon = 2;</code>
       */
      private com.google.protobuf.SingleFieldBuilder<
          org.bwapi.proxy.messages.TerrainMessages.Polygon, org.bwapi.proxy.messages.TerrainMessages.Polygon.Builder, org.bwapi.proxy.messages.TerrainMessages.PolygonOrBuilder> 
          getPolygonFieldBuilder() {
        if (polygonBuilder_ == null) {
          polygonBuilder_ = new com.google.protobuf.SingleFieldBuilder<
              org.bwapi.proxy.messages.TerrainMessages.Polygon, org.bwapi.proxy.messages.TerrainMessages.Polygon.Builder, org.bwapi.proxy.messages.TerrainMessages.PolygonOrBuilder>(
                  polygon_,
                  getParentForChildren(),
                  isClean());
          polygon_ = null;
        }
        return polygonBuilder_;
      }

      // repeated int32 chokepoints = 3;
      private java.util.List<java.lang.Integer> chokepoints_ = java.util.Collections.emptyList();
      private void ensureChokepointsIsMutable() {
        if (!((bitField0_ & 0x00000004) == 0x00000004)) {
          chokepoints_ = new java.util.ArrayList<java.lang.Integer>(chokepoints_);
          bitField0_ |= 0x00000004;
         }
      }
      /**
       * <code>repeated int32 chokepoints = 3;</code>
       */
      public java.util.List<java.lang.Integer>
          getChokepointsList() {
        return java.util.Collections.unmodifiableList(chokepoints_);
      }
      /**
       * <code>repeated int32 chokepoints = 3;</code>
       */
      public int getChokepointsCount() {
        return chokepoints_.size();
      }
      /**
       * <code>repeated int32 chokepoints = 3;</code>
       */
      public int getChokepoints(int index) {
        return chokepoints_.get(index);
      }
      /**
       * <code>repeated int32 chokepoints = 3;</code>
       */
      public Builder setChokepoints(
          int index, int value) {
        ensureChokepointsIsMutable();
        chokepoints_.set(index, value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated int32 chokepoints = 3;</code>
       */
      public Builder addChokepoints(int value) {
        ensureChokepointsIsMutable();
        chokepoints_.add(value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated int32 chokepoints = 3;</code>
       */
      public Builder addAllChokepoints(
          java.lang.Iterable<? extends java.lang.Integer> values) {
        ensureChokepointsIsMutable();
        super.addAll(values, chokepoints_);
        onChanged();
        return this;
      }
      /**
       * <code>repeated int32 chokepoints = 3;</code>
       */
      public Builder clearChokepoints() {
        chokepoints_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000004);
        onChanged();
        return this;
      }

      // repeated int32 baseLocations = 4;
      private java.util.List<java.lang.Integer> baseLocations_ = java.util.Collections.emptyList();
      private void ensureBaseLocationsIsMutable() {
        if (!((bitField0_ & 0x00000008) == 0x00000008)) {
          baseLocations_ = new java.util.ArrayList<java.lang.Integer>(baseLocations_);
          bitField0_ |= 0x00000008;
         }
      }
      /**
       * <code>repeated int32 baseLocations = 4;</code>
       */
      public java.util.List<java.lang.Integer>
          getBaseLocationsList() {
        return java.util.Collections.unmodifiableList(baseLocations_);
      }
      /**
       * <code>repeated int32 baseLocations = 4;</code>
       */
      public int getBaseLocationsCount() {
        return baseLocations_.size();
      }
      /**
       * <code>repeated int32 baseLocations = 4;</code>
       */
      public int getBaseLocations(int index) {
        return baseLocations_.get(index);
      }
      /**
       * <code>repeated int32 baseLocations = 4;</code>
       */
      public Builder setBaseLocations(
          int index, int value) {
        ensureBaseLocationsIsMutable();
        baseLocations_.set(index, value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated int32 baseLocations = 4;</code>
       */
      public Builder addBaseLocations(int value) {
        ensureBaseLocationsIsMutable();
        baseLocations_.add(value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated int32 baseLocations = 4;</code>
       */
      public Builder addAllBaseLocations(
          java.lang.Iterable<? extends java.lang.Integer> values) {
        ensureBaseLocationsIsMutable();
        super.addAll(values, baseLocations_);
        onChanged();
        return this;
      }
      /**
       * <code>repeated int32 baseLocations = 4;</code>
       */
      public Builder clearBaseLocations() {
        baseLocations_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000008);
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:messages.Region)
    }

    static {
      defaultInstance = new Region(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:messages.Region)
  }

  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_messages_DynamicTerrainInfo_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_messages_DynamicTerrainInfo_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_messages_StaticTerrainInfo_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_messages_StaticTerrainInfo_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_messages_BaseLocation_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_messages_BaseLocation_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_messages_Chokepoint_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_messages_Chokepoint_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_messages_Polygon_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_messages_Polygon_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_messages_Region_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_messages_Region_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n\rterrain.proto\022\010messages\032\013types.proto\032\n" +
      "unit.proto\"M\n\022DynamicTerrainInfo\022\021\n\tisVi" +
      "sible\030\003 \003(\007\022\022\n\nisExplored\030\004 \003(\007\022\020\n\010hasCr" +
      "eep\030\005 \003(\007\"\326\001\n\021StaticTerrainInfo\022!\n\007regio" +
      "ns\030\001 \003(\0132\020.messages.Region\022)\n\013chokepoint" +
      "s\030\002 \003(\0132\024.messages.Chokepoint\022-\n\rbaseLoc" +
      "ations\030\003 \003(\0132\026.messages.BaseLocation\022\026\n\016" +
      "startLocations\030\004 \003(\005\022,\n\021unwalkablePolygo" +
      "n\030\005 \003(\0132\021.messages.Polygon\"\320\002\n\014BaseLocat" +
      "ion\022\n\n\002id\030\014 \002(\005\022$\n\010position\030\001 \002(\0132\022.mess",
      "ages.Position\022,\n\014tilePosition\030\r \002(\0132\026.me" +
      "ssages.TilePosition\022\016\n\006region\030\002 \002(\005\022\023\n\013n" +
      "umMinerals\030\003 \002(\005\022\016\n\006numGas\030\004 \002(\005\022\"\n\010mine" +
      "rals\030\005 \003(\0132\020.messages.UnitId\022(\n\016staticMi" +
      "nerals\030\006 \003(\0132\020.messages.UnitId\022!\n\007geyser" +
      "s\030\007 \003(\0132\020.messages.UnitId\022\016\n\006island\030\010 \002(" +
      "\010\022\023\n\013mineralOnly\030\n \002(\010\022\025\n\rstartLocation\030" +
      "\013 \002(\010\"\263\001\n\nChokepoint\022\n\n\002id\030\007 \002(\005\022\017\n\007regi" +
      "on1\030\001 \002(\005\022\017\n\007region2\030\002 \002(\005\022!\n\005side1\030\003 \002(" +
      "\0132\022.messages.Position\022!\n\005side2\030\004 \002(\0132\022.m",
      "essages.Position\022\"\n\006center\030\005 \002(\0132\022.messa" +
      "ges.Position\022\r\n\005width\030\006 \002(\001\"\226\001\n\007Polygon\022" +
      "$\n\010vertices\030\001 \003(\0132\022.messages.Position\022\014\n" +
      "\004area\030\002 \002(\001\022\021\n\tperimeter\030\003 \002(\001\022\"\n\006center" +
      "\030\004 \002(\0132\022.messages.Position\022 \n\005holes\030\005 \003(" +
      "\0132\021.messages.Polygon\"d\n\006Region\022\n\n\002id\030\001 \002" +
      "(\005\022\"\n\007polygon\030\002 \002(\0132\021.messages.Polygon\022\023" +
      "\n\013chokepoints\030\003 \003(\005\022\025\n\rbaseLocations\030\004 \003" +
      "(\005B+\n\030org.bwapi.proxy.messagesB\017TerrainM" +
      "essages"
    };
    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
      new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
        public com.google.protobuf.ExtensionRegistry assignDescriptors(
            com.google.protobuf.Descriptors.FileDescriptor root) {
          descriptor = root;
          internal_static_messages_DynamicTerrainInfo_descriptor =
            getDescriptor().getMessageTypes().get(0);
          internal_static_messages_DynamicTerrainInfo_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_messages_DynamicTerrainInfo_descriptor,
              new java.lang.String[] { "IsVisible", "IsExplored", "HasCreep", });
          internal_static_messages_StaticTerrainInfo_descriptor =
            getDescriptor().getMessageTypes().get(1);
          internal_static_messages_StaticTerrainInfo_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_messages_StaticTerrainInfo_descriptor,
              new java.lang.String[] { "Regions", "Chokepoints", "BaseLocations", "StartLocations", "UnwalkablePolygon", });
          internal_static_messages_BaseLocation_descriptor =
            getDescriptor().getMessageTypes().get(2);
          internal_static_messages_BaseLocation_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_messages_BaseLocation_descriptor,
              new java.lang.String[] { "Id", "Position", "TilePosition", "Region", "NumMinerals", "NumGas", "Minerals", "StaticMinerals", "Geysers", "Island", "MineralOnly", "StartLocation", });
          internal_static_messages_Chokepoint_descriptor =
            getDescriptor().getMessageTypes().get(3);
          internal_static_messages_Chokepoint_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_messages_Chokepoint_descriptor,
              new java.lang.String[] { "Id", "Region1", "Region2", "Side1", "Side2", "Center", "Width", });
          internal_static_messages_Polygon_descriptor =
            getDescriptor().getMessageTypes().get(4);
          internal_static_messages_Polygon_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_messages_Polygon_descriptor,
              new java.lang.String[] { "Vertices", "Area", "Perimeter", "Center", "Holes", });
          internal_static_messages_Region_descriptor =
            getDescriptor().getMessageTypes().get(5);
          internal_static_messages_Region_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_messages_Region_descriptor,
              new java.lang.String[] { "Id", "Polygon", "Chokepoints", "BaseLocations", });
          return null;
        }
      }