CommonTypes.cs 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. // <copyright file="CommonTypes.cs" company="Google Inc.">
  2. // Copyright (C) 2014 Google Inc.
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. // </copyright>
  16. namespace GooglePlayGames.BasicApi
  17. {
  18. /// <summary>
  19. /// A enum describing where game data can be fetched from.
  20. /// </summary>
  21. public enum DataSource
  22. {
  23. /// <summary>
  24. /// Allow a read from either a local cache, or the network.
  25. /// </summary>
  26. /// <remarks> Values from the cache may be
  27. /// stale (potentially producing more write conflicts), but reading from cache may still
  28. /// allow reads to succeed if the device does not have internet access and may complete more
  29. /// quickly (as the reads can occur locally rather requiring network roundtrips).
  30. /// </remarks>
  31. ReadCacheOrNetwork,
  32. /// <summary>
  33. /// Only allow reads from network.
  34. /// </summary>
  35. /// <remarks> This guarantees any returned values were current at the time
  36. /// the read succeeded, but prevents reads from succeeding if the network is unavailable for
  37. /// any reason.
  38. /// </remarks>
  39. ReadNetworkOnly
  40. }
  41. /// <summary> Native response status codes</status>
  42. /// <remarks> These values are returned by the native SDK API.
  43. /// NOTE: These values are different than the CommonStatusCodes.
  44. /// </remarks>
  45. public enum ResponseStatus
  46. {
  47. /// <summary>The operation was successful.</summary>
  48. Success = 1,
  49. /// <summary>The operation was successful, but the device's cache was used.</summary>
  50. SuccessWithStale = 2,
  51. /// <summary>The application is not licensed to the user.</summary>
  52. LicenseCheckFailed = -1,
  53. /// <summary>An internal error occurred.</summary>
  54. InternalError = -2,
  55. /// <summary>The player is not authorized to perform the operation.</summary>
  56. NotAuthorized = -3,
  57. /// <summary>The installed version of Google Play services is out of date.</summary>
  58. VersionUpdateRequired = -4,
  59. /// <summary>Timed out while awaiting the result.</summary>
  60. Timeout = -5,
  61. }
  62. /// <summary> Native response status codes for UI operations.</status>
  63. /// <remarks> These values are returned by the native SDK API.
  64. /// </remarks>
  65. public enum UIStatus
  66. {
  67. /// <summary>The result is valid.</summary>
  68. Valid = 1,
  69. /// <summary>An internal error occurred.</summary>
  70. InternalError = -2,
  71. /// <summary>The player is not authorized to perform the operation.</summary>
  72. NotAuthorized = -3,
  73. /// <summary>The installed version of Google Play services is out of date.</summary>
  74. VersionUpdateRequired = -4,
  75. Timeout = -5,
  76. /// <summary>Timed out while awaiting the result.</summary>
  77. UserClosedUI = -6,
  78. /// <summary>UI closed by user.</summary>
  79. UiBusy = -12,
  80. /// <summary>The player left the multiplayer room.</summary>
  81. LeftRoom = -18,
  82. }
  83. /// <summary>Values specifying the start location for fetching scores.</summary>
  84. public enum LeaderboardStart
  85. {
  86. /// <summary>Start fetching scores from the top of the list.</summary>
  87. TopScores = 1,
  88. /// <summary>Start fetching relative to the player's score.</summary>
  89. PlayerCentered = 2,
  90. }
  91. /// <summary>Values specifying which leaderboard timespan to use.</summary>
  92. public enum LeaderboardTimeSpan
  93. {
  94. /// <summary>Daily scores. The day resets at 11:59 PM PST.</summary>
  95. Daily = 1,
  96. /// <summary>Weekly scores. The week resets at 11:59 PM PST on Sunday.</summary>
  97. Weekly = 2,
  98. /// <summary>All time scores.</summary>
  99. AllTime = 3,
  100. }
  101. /// <summary>Values specifying which leaderboard collection to use.</summary>
  102. public enum LeaderboardCollection
  103. {
  104. /// <summary>Public leaderboards contain the scores of players who are sharing their gameplay publicly.</summary>
  105. Public = 1,
  106. /// <summary>Social leaderboards contain the scores of players in the viewing player's circles.</summary>
  107. Social = 2,
  108. }
  109. public enum VideoCaptureMode {
  110. /// <summary>An unknown value to return when capture mode is not available.</summary>
  111. Unknown = -1,
  112. /// <summary>Capture device audio and video to a local file.</summary>
  113. File = 0,
  114. /// <summary>Capture device audio and video, and stream it live.</summary>
  115. /// <remarks>Not currently supported in the Unity Plugin.</remarks>
  116. Stream = 1 // Not currently supported in the Unity Plugin.
  117. }
  118. public enum VideoQualityLevel {
  119. /// <summary>An unknown value to return when quality level is not available.</summary>
  120. Unknown = -1,
  121. /// <summary>SD quality: Standard def resolution (e.g. 480p) and a low bit rate (e.g. 1-2Mbps).</summary>
  122. SD = 0,
  123. /// <summary>HD quality: DVD HD resolution (i.e. 720p) and a medium bit rate (e.g. 3-4Mbps).</summary>
  124. HD = 1,
  125. /// <summary>Extreme HD quality: BluRay HD resolution (i.e. 1080p) and a high bit rate (e.g. 6-8Mbps).</summary>
  126. XHD = 2,
  127. /// <summary>Full HD quality: 2160P resolution and high bit rate, e.g. 10-12Mbps.</summary>
  128. FullHD = 3
  129. }
  130. public enum VideoCaptureOverlayState {
  131. /// <summary>State used to indicate that the state of the capture overlay is unknown.</summary>
  132. /// <remarks>This usually indicates an error.</remarks>
  133. Unknown = -1,
  134. /// <summary>State used to indicate that the capture overlay is drawn on the screen and visible to the user.</summary>
  135. Shown = 1,
  136. /// <summary>State used to indicate that the user has initiated capture via the capture overlay.</summary>
  137. Started = 2,
  138. /// <summary>State used to indicate that the user has stopped capturing via the capture overlay.</summary>
  139. Stopped = 3,
  140. /// <summary>State used to indicate that the user has dismissed the capture overlay and it is no longer visible.</summary>
  141. Dismissed = 4
  142. }
  143. public enum Gravity
  144. {
  145. TOP = 48,
  146. BOTTOM = 80,
  147. LEFT = 3,
  148. RIGHT = 5,
  149. CENTER_HORIZONTAL = 1
  150. }
  151. public class CommonTypesUtil {
  152. public static bool StatusIsSuccess(ResponseStatus status)
  153. {
  154. return ((int)status) > 0;
  155. }
  156. }
  157. }