sample

package
v0.0.0-...-e165f0f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SpacingOptions_PointType_name = map[int32]string{
	0: "POINT_TYPE_UNSPECIFIED",
	1: "CENTER_POINT",
	2: "SNAPPED_POINT",
}
View Source
var SpacingOptions_PointType_value = map[string]int32{
	"POINT_TYPE_UNSPECIFIED": 0,
	"CENTER_POINT":           1,
	"SNAPPED_POINT":          2,
}

Functions

This section is empty.

Types

type AreaFilter

type AreaFilter struct {
	// Required. The S2 cell ID of the area you want. This must be between cell level 11 and
	// 14 (inclusive).
	//
	// S2 cells are 64-bit integers that identify areas on the Earth. They are
	// hierarchical, and can therefore be used for spatial indexing.
	//
	// The S2 geometry library is available in a number of languages:
	//
	//   * [C++](https://github.com/google/s2geometry)
	//   * [Java](https://github.com/google/s2-geometry-library-java)
	//   * [Go](https://github.com/golang/geo)
	//   * [Python](https://github.com/google/s2geometry/tree/master/src/python)
	S2CellId             uint64   `protobuf:"fixed64,1,opt,name=s2_cell_id,json=s2CellId,proto3" json:"s2_cell_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Specifies the area to search for playable locations.

func (*AreaFilter) Descriptor

func (*AreaFilter) Descriptor() ([]byte, []int)

func (*AreaFilter) GetS2CellId

func (m *AreaFilter) GetS2CellId() uint64

func (*AreaFilter) ProtoMessage

func (*AreaFilter) ProtoMessage()

func (*AreaFilter) Reset

func (m *AreaFilter) Reset()

func (*AreaFilter) String

func (m *AreaFilter) String() string

func (*AreaFilter) XXX_DiscardUnknown

func (m *AreaFilter) XXX_DiscardUnknown()

func (*AreaFilter) XXX_Marshal

func (m *AreaFilter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AreaFilter) XXX_Merge

func (m *AreaFilter) XXX_Merge(src proto.Message)

func (*AreaFilter) XXX_Size

func (m *AreaFilter) XXX_Size() int

func (*AreaFilter) XXX_Unmarshal

func (m *AreaFilter) XXX_Unmarshal(b []byte) error

type Criterion

type Criterion struct {
	// Required. An arbitrary, developer-defined identifier of the type of game object that
	// the playable location is used for. This field allows you to specify
	// criteria per game object type when searching for playable locations.
	//
	// You should assign a unique `game_object_type` ID across all
	// `request_criteria` to represent a distinct type of game object. For
	// example, 1=monster location, 2=powerup location.
	//
	// The response contains a map<game_object_type, Response>.
	GameObjectType int32 `protobuf:"varint,1,opt,name=game_object_type,json=gameObjectType,proto3" json:"game_object_type,omitempty"`
	// Specifies filtering options, and specifies what will be included in the
	// result set.
	Filter *Filter `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"`
	// Specifies which `PlayableLocation` fields are returned.
	//
	// `name` (which is used for logging impressions), `center_point` and
	// `place_id` (or `plus_code`) are always returned.
	//
	// The following fields are omitted unless you specify them here:
	//
	//   * snapped_point
	//   * types
	//
	// Note: The more fields you include, the more expensive in terms of data and
	// associated latency your query will be.
	FieldsToReturn       *field_mask.FieldMask `protobuf:"bytes,3,opt,name=fields_to_return,json=fieldsToReturn,proto3" json:"fields_to_return,omitempty"`
	XXX_NoUnkeyedLiteral struct{}              `json:"-"`
	XXX_unrecognized     []byte                `json:"-"`
	XXX_sizecache        int32                 `json:"-"`
}

Encapsulates a filter criterion for searching for a set of playable locations.

func (*Criterion) Descriptor

func (*Criterion) Descriptor() ([]byte, []int)

func (*Criterion) GetFieldsToReturn

func (m *Criterion) GetFieldsToReturn() *field_mask.FieldMask

func (*Criterion) GetFilter

func (m *Criterion) GetFilter() *Filter

func (*Criterion) GetGameObjectType

func (m *Criterion) GetGameObjectType() int32

func (*Criterion) ProtoMessage

func (*Criterion) ProtoMessage()

func (*Criterion) Reset

func (m *Criterion) Reset()

func (*Criterion) String

func (m *Criterion) String() string

func (*Criterion) XXX_DiscardUnknown

func (m *Criterion) XXX_DiscardUnknown()

func (*Criterion) XXX_Marshal

func (m *Criterion) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Criterion) XXX_Merge

func (m *Criterion) XXX_Merge(src proto.Message)

func (*Criterion) XXX_Size

func (m *Criterion) XXX_Size() int

func (*Criterion) XXX_Unmarshal

func (m *Criterion) XXX_Unmarshal(b []byte) error

type Filter

type Filter struct {
	// Specifies the maximum number of playable locations to return. This value
	// must not be greater than 500. The default value is 100.
	//
	// Only the top-ranking playable locations are returned.
	MaxLocationCount int32 `protobuf:"varint,1,opt,name=max_location_count,json=maxLocationCount,proto3" json:"max_location_count,omitempty"`
	// A set of options that control the spacing between playable locations. By
	// default the minimum distance between locations is 200m.
	Spacing *SpacingOptions `protobuf:"bytes,2,opt,name=spacing,proto3" json:"spacing,omitempty"`
	// Restricts the set of playable locations to just the
	// [types](/maps/tt/games/types) that you want.
	IncludedTypes        []string `protobuf:"bytes,3,rep,name=included_types,json=includedTypes,proto3" json:"included_types,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Specifies the filters to use when searching for playable locations.

func (*Filter) Descriptor

func (*Filter) Descriptor() ([]byte, []int)

func (*Filter) GetIncludedTypes

func (m *Filter) GetIncludedTypes() []string

func (*Filter) GetMaxLocationCount

func (m *Filter) GetMaxLocationCount() int32

func (*Filter) GetSpacing

func (m *Filter) GetSpacing() *SpacingOptions

func (*Filter) ProtoMessage

func (*Filter) ProtoMessage()

func (*Filter) Reset

func (m *Filter) Reset()

func (*Filter) String

func (m *Filter) String() string

func (*Filter) XXX_DiscardUnknown

func (m *Filter) XXX_DiscardUnknown()

func (*Filter) XXX_Marshal

func (m *Filter) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Filter) XXX_Merge

func (m *Filter) XXX_Merge(src proto.Message)

func (*Filter) XXX_Size

func (m *Filter) XXX_Size() int

func (*Filter) XXX_Unmarshal

func (m *Filter) XXX_Unmarshal(b []byte) error

type PlayableLocation

type PlayableLocation struct {
	// Required. The name of this playable location.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Required.
	// Each location has one of the following identifiers:
	//
	// Types that are valid to be assigned to LocationId:
	//	*PlayableLocation_PlaceId
	//	*PlayableLocation_PlusCode
	LocationId isPlayableLocation_LocationId `protobuf_oneof:"location_id"`
	// A collection of [Playable Location Types](/maps/tt/games/types) for this
	// playable location. The first type in the collection is the primary type.
	//
	// Type information might not be available for all playable locations.
	Types []string `protobuf:"bytes,4,rep,name=types,proto3" json:"types,omitempty"`
	// Required. The latitude and longitude associated with the center of the playable
	// location.
	//
	// By default, the set of playable locations returned from
	// [SamplePlayableLocations][google.maps.playablelocations.v3.PlayableLocations.SamplePlayableLocations] use
	// center-point coordinates.
	CenterPoint *latlng.LatLng `protobuf:"bytes,5,opt,name=center_point,json=centerPoint,proto3" json:"center_point,omitempty"`
	// The playable location's coordinates, snapped to the sidewalk of the
	// nearest road, if a nearby road exists.
	SnappedPoint         *latlng.LatLng `protobuf:"bytes,6,opt,name=snapped_point,json=snappedPoint,proto3" json:"snapped_point,omitempty"`
	XXX_NoUnkeyedLiteral struct{}       `json:"-"`
	XXX_unrecognized     []byte         `json:"-"`
	XXX_sizecache        int32          `json:"-"`
}

A geographical point suitable for placing game objects in location-based games.

func (*PlayableLocation) Descriptor

func (*PlayableLocation) Descriptor() ([]byte, []int)

func (*PlayableLocation) GetCenterPoint

func (m *PlayableLocation) GetCenterPoint() *latlng.LatLng

func (*PlayableLocation) GetLocationId

func (m *PlayableLocation) GetLocationId() isPlayableLocation_LocationId

func (*PlayableLocation) GetName

func (m *PlayableLocation) GetName() string

func (*PlayableLocation) GetPlaceId

func (m *PlayableLocation) GetPlaceId() string

func (*PlayableLocation) GetPlusCode

func (m *PlayableLocation) GetPlusCode() string

func (*PlayableLocation) GetSnappedPoint

func (m *PlayableLocation) GetSnappedPoint() *latlng.LatLng

func (*PlayableLocation) GetTypes

func (m *PlayableLocation) GetTypes() []string

func (*PlayableLocation) ProtoMessage

func (*PlayableLocation) ProtoMessage()

func (*PlayableLocation) Reset

func (m *PlayableLocation) Reset()

func (*PlayableLocation) String

func (m *PlayableLocation) String() string

func (*PlayableLocation) XXX_DiscardUnknown

func (m *PlayableLocation) XXX_DiscardUnknown()

func (*PlayableLocation) XXX_Marshal

func (m *PlayableLocation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PlayableLocation) XXX_Merge

func (m *PlayableLocation) XXX_Merge(src proto.Message)

func (*PlayableLocation) XXX_OneofWrappers

func (*PlayableLocation) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*PlayableLocation) XXX_Size

func (m *PlayableLocation) XXX_Size() int

func (*PlayableLocation) XXX_Unmarshal

func (m *PlayableLocation) XXX_Unmarshal(b []byte) error

type PlayableLocationList

type PlayableLocationList struct {
	// A list of playable locations for this game object type.
	Locations            []*PlayableLocation `protobuf:"bytes,1,rep,name=locations,proto3" json:"locations,omitempty"`
	XXX_NoUnkeyedLiteral struct{}            `json:"-"`
	XXX_unrecognized     []byte              `json:"-"`
	XXX_sizecache        int32               `json:"-"`
}

A list of PlayableLocation objects that satisfies a single Criterion.

func (*PlayableLocationList) Descriptor

func (*PlayableLocationList) Descriptor() ([]byte, []int)

func (*PlayableLocationList) GetLocations

func (m *PlayableLocationList) GetLocations() []*PlayableLocation

func (*PlayableLocationList) ProtoMessage

func (*PlayableLocationList) ProtoMessage()

func (*PlayableLocationList) Reset

func (m *PlayableLocationList) Reset()

func (*PlayableLocationList) String

func (m *PlayableLocationList) String() string

func (*PlayableLocationList) XXX_DiscardUnknown

func (m *PlayableLocationList) XXX_DiscardUnknown()

func (*PlayableLocationList) XXX_Marshal

func (m *PlayableLocationList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PlayableLocationList) XXX_Merge

func (m *PlayableLocationList) XXX_Merge(src proto.Message)

func (*PlayableLocationList) XXX_Size

func (m *PlayableLocationList) XXX_Size() int

func (*PlayableLocationList) XXX_Unmarshal

func (m *PlayableLocationList) XXX_Unmarshal(b []byte) error

type PlayableLocation_PlaceId

type PlayableLocation_PlaceId struct {
	PlaceId string `protobuf:"bytes,2,opt,name=place_id,json=placeId,proto3,oneof"`
}

type PlayableLocation_PlusCode

type PlayableLocation_PlusCode struct {
	PlusCode string `protobuf:"bytes,3,opt,name=plus_code,json=plusCode,proto3,oneof"`
}

type SpacingOptions

type SpacingOptions struct {
	// Required. The minimum spacing between any two playable locations, measured in meters.
	// The minimum value is 200.
	// The maximum value is 1000.
	//
	// Inputs will be rounded up to the next 10 meter interval.
	//
	// The default value is 200m.
	//
	// Set this field to remove tight clusters of playable locations.
	//
	// Note:
	//
	// The spacing is a greedy algorithm. It optimizes for selecting the highest
	// ranking locations first, not to maximize the number of locations selected.
	// Consider the following scenario:
	//
	//   * Rank: A: 2, B: 1, C: 3.
	//   * Distance: A--200m--B--200m--C
	//
	// If spacing=250, it will pick the highest ranked location [B], not [A, C].
	//
	//
	// Note:
	//
	// Spacing works within the game object type itself, as well as the previous
	// ones.
	// Suppose three game object types, each with the following spacing:
	//
	//   * X: 400m, Y: undefined, Z: 200m.
	//
	// 1. Add locations for X, within 400m of each other.
	// 2. Add locations for Y, without any spacing.
	// 3. Finally, add locations for Z within 200m of each other as well X and Y.
	//
	// The distance diagram between those locations end up as:
	//
	//   * From->To.
	//   * X->X: 400m
	//   * Y->X, Y->Y: unspecified.
	//   * Z->X, Z->Y, Z->Z: 200m.
	MinSpacingMeters float64 `protobuf:"fixed64,1,opt,name=min_spacing_meters,json=minSpacingMeters,proto3" json:"min_spacing_meters,omitempty"`
	// Specifies whether the minimum spacing constraint applies to the
	// center-point or to the snapped point of playable locations. The default
	// value is `CENTER_POINT`.
	//
	// If a snapped point is not available for a playable location, its
	// center-point is used instead.
	//
	// Set this to the point type used in your game.
	PointType            SpacingOptions_PointType `` /* 159-byte string literal not displayed */
	XXX_NoUnkeyedLiteral struct{}                 `json:"-"`
	XXX_unrecognized     []byte                   `json:"-"`
	XXX_sizecache        int32                    `json:"-"`
}

A set of options that specifies the separation between playable locations.

func (*SpacingOptions) Descriptor

func (*SpacingOptions) Descriptor() ([]byte, []int)

func (*SpacingOptions) GetMinSpacingMeters

func (m *SpacingOptions) GetMinSpacingMeters() float64

func (*SpacingOptions) GetPointType

func (m *SpacingOptions) GetPointType() SpacingOptions_PointType

func (*SpacingOptions) ProtoMessage

func (*SpacingOptions) ProtoMessage()

func (*SpacingOptions) Reset

func (m *SpacingOptions) Reset()

func (*SpacingOptions) String

func (m *SpacingOptions) String() string

func (*SpacingOptions) XXX_DiscardUnknown

func (m *SpacingOptions) XXX_DiscardUnknown()

func (*SpacingOptions) XXX_Marshal

func (m *SpacingOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*SpacingOptions) XXX_Merge

func (m *SpacingOptions) XXX_Merge(src proto.Message)

func (*SpacingOptions) XXX_Size

func (m *SpacingOptions) XXX_Size() int

func (*SpacingOptions) XXX_Unmarshal

func (m *SpacingOptions) XXX_Unmarshal(b []byte) error

type SpacingOptions_PointType

type SpacingOptions_PointType int32

Specifies whether the playable location's geographic coordinates (latitude and longitude) correspond to its center-point, or to its location snapped to the sidewalk of the nearest road.

const (
	// Unspecified point type. Do not use this value.
	SpacingOptions_POINT_TYPE_UNSPECIFIED SpacingOptions_PointType = 0
	// The geographic coordinates correspond to the center of the location.
	SpacingOptions_CENTER_POINT SpacingOptions_PointType = 1
	// The geographic coordinates correspond to the location snapped to the
	// sidewalk of the nearest road (when a nearby road exists).
	SpacingOptions_SNAPPED_POINT SpacingOptions_PointType = 2
)

func (SpacingOptions_PointType) EnumDescriptor

func (SpacingOptions_PointType) EnumDescriptor() ([]byte, []int)

func (SpacingOptions_PointType) String

func (x SpacingOptions_PointType) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL