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;
        }
      }