resources.proto 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. // Copyright 2020 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.maps.playablelocations.v3.sample;
  16. import "google/api/field_behavior.proto";
  17. import "google/protobuf/field_mask.proto";
  18. import "google/type/latlng.proto";
  19. option csharp_namespace = "Google.Maps.PlayableLocations.V3.Sample";
  20. option go_package = "google.golang.org/genproto/googleapis/maps/playablelocations/v3/sample;sample";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "ResourcesProto";
  23. option java_package = "com.google.maps.playablelocations.v3.sample";
  24. option objc_class_prefix = "GMPL";
  25. // A geographical point suitable for placing game objects in location-based
  26. // games.
  27. message PlayableLocation {
  28. // Required. The name of this playable location.
  29. string name = 1;
  30. // Required.
  31. // Each location has one of the following identifiers:
  32. oneof location_id {
  33. // A [place ID] (https://developers.google.com/places/place-id)
  34. string place_id = 2;
  35. // A [plus code] (http://openlocationcode.com)
  36. string plus_code = 3;
  37. }
  38. // A collection of [Playable Location Types](/maps/tt/games/types) for this
  39. // playable location. The first type in the collection is the primary type.
  40. //
  41. // Type information might not be available for all playable locations.
  42. repeated string types = 4;
  43. // Required. The latitude and longitude associated with the center of the
  44. // playable location.
  45. //
  46. // By default, the set of playable locations returned from
  47. // [SamplePlayableLocations][google.maps.playablelocations.v3.PlayableLocations.SamplePlayableLocations]
  48. // use center-point coordinates.
  49. google.type.LatLng center_point = 5;
  50. // The playable location's coordinates, snapped to the sidewalk of the
  51. // nearest road, if a nearby road exists.
  52. google.type.LatLng snapped_point = 6;
  53. }
  54. // A set of options that specifies the separation between playable locations.
  55. message SpacingOptions {
  56. // Specifies whether the playable location's geographic coordinates (latitude
  57. // and longitude) correspond to its center-point, or to its location snapped
  58. // to the sidewalk of the nearest road.
  59. enum PointType {
  60. // Unspecified point type. Do not use this value.
  61. POINT_TYPE_UNSPECIFIED = 0;
  62. // The geographic coordinates correspond to the center of the location.
  63. CENTER_POINT = 1;
  64. // The geographic coordinates correspond to the location snapped to the
  65. // sidewalk of the nearest road (when a nearby road exists).
  66. SNAPPED_POINT = 2;
  67. }
  68. // Required. The minimum spacing between any two playable locations, measured
  69. // in meters. The minimum value is 30. The maximum value is 1000.
  70. //
  71. // Inputs will be rounded up to the next 10 meter interval.
  72. //
  73. // The default value is 200m.
  74. //
  75. // Set this field to remove tight clusters of playable locations.
  76. //
  77. // Note:
  78. //
  79. // The spacing is a greedy algorithm. It optimizes for selecting the highest
  80. // ranking locations first, not to maximize the number of locations selected.
  81. // Consider the following scenario:
  82. //
  83. // * Rank: A: 2, B: 1, C: 3.
  84. // * Distance: A--200m--B--200m--C
  85. //
  86. // If spacing=250, it will pick the highest ranked location [B], not [A, C].
  87. //
  88. //
  89. // Note:
  90. //
  91. // Spacing works within the game object type itself, as well as the previous
  92. // ones.
  93. // Suppose three game object types, each with the following spacing:
  94. //
  95. // * X: 400m, Y: undefined, Z: 200m.
  96. //
  97. // 1. Add locations for X, within 400m of each other.
  98. // 2. Add locations for Y, without any spacing.
  99. // 3. Finally, add locations for Z within 200m of each other as well X and Y.
  100. //
  101. // The distance diagram between those locations end up as:
  102. //
  103. // * From->To.
  104. // * X->X: 400m
  105. // * Y->X, Y->Y: unspecified.
  106. // * Z->X, Z->Y, Z->Z: 200m.
  107. double min_spacing_meters = 1 [(google.api.field_behavior) = REQUIRED];
  108. // Specifies whether the minimum spacing constraint applies to the
  109. // center-point or to the snapped point of playable locations. The default
  110. // value is `CENTER_POINT`.
  111. //
  112. // If a snapped point is not available for a playable location, its
  113. // center-point is used instead.
  114. //
  115. // Set this to the point type used in your game.
  116. PointType point_type = 2;
  117. }
  118. // Specifies the filters to use when searching for playable locations.
  119. message Filter {
  120. // Specifies the maximum number of playable locations to return. This value
  121. // must not be greater than 1000. The default value is 100.
  122. //
  123. // Only the top-ranking playable locations are returned.
  124. int32 max_location_count = 1;
  125. // A set of options that control the spacing between playable locations. By
  126. // default the minimum distance between locations is 200m.
  127. SpacingOptions spacing = 2;
  128. // Restricts the set of playable locations to just the
  129. // [types](/maps/tt/games/types) that you want.
  130. repeated string included_types = 3;
  131. }
  132. // Encapsulates a filter criterion for searching for a set of playable
  133. // locations.
  134. message Criterion {
  135. // Required. An arbitrary, developer-defined identifier of the type of game
  136. // object that the playable location is used for. This field allows you to
  137. // specify criteria per game object type when searching for playable
  138. // locations.
  139. //
  140. // You should assign a unique `game_object_type` ID across all
  141. // `request_criteria` to represent a distinct type of game object. For
  142. // example, 1=monster location, 2=powerup location.
  143. //
  144. // The response contains a map<game_object_type, Response>.
  145. int32 game_object_type = 1 [(google.api.field_behavior) = REQUIRED];
  146. // Specifies filtering options, and specifies what will be included in the
  147. // result set.
  148. Filter filter = 2;
  149. // Specifies which `PlayableLocation` fields are returned.
  150. //
  151. // `name` (which is used for logging impressions), `center_point` and
  152. // `place_id` (or `plus_code`) are always returned.
  153. //
  154. // The following fields are omitted unless you specify them here:
  155. //
  156. // * snapped_point
  157. // * types
  158. //
  159. // Note: The more fields you include, the more expensive in terms of data and
  160. // associated latency your query will be.
  161. google.protobuf.FieldMask fields_to_return = 3;
  162. }
  163. // Specifies the area to search for playable locations.
  164. message AreaFilter {
  165. // Required. The S2 cell ID of the area you want. This must be between cell
  166. // level 11 and 14 (inclusive).
  167. //
  168. // S2 cells are 64-bit integers that identify areas on the Earth. They are
  169. // hierarchical, and can therefore be used for spatial indexing.
  170. //
  171. // The S2 geometry library is available in a number of languages:
  172. //
  173. // * [C++](https://github.com/google/s2geometry)
  174. // * [Java](https://github.com/google/s2-geometry-library-java)
  175. // * [Go](https://github.com/golang/geo)
  176. // * [Python](https://github.com/google/s2geometry/tree/master/src/python)
  177. fixed64 s2_cell_id = 1 [(google.api.field_behavior) = REQUIRED];
  178. }
  179. // A list of PlayableLocation objects that satisfies a single Criterion.
  180. message PlayableLocationList {
  181. // A list of playable locations for this game object type.
  182. repeated PlayableLocation locations = 1;
  183. }