//
// Copyright (C) 2014 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
namespace GooglePlayGames.BasicApi
{
///
/// A enum describing where game data can be fetched from.
///
public enum DataSource
{
///
/// Allow a read from either a local cache, or the network.
///
/// Values from the cache may be
/// stale (potentially producing more write conflicts), but reading from cache may still
/// allow reads to succeed if the device does not have internet access and may complete more
/// quickly (as the reads can occur locally rather requiring network roundtrips).
///
ReadCacheOrNetwork,
///
/// Only allow reads from network.
///
/// This guarantees any returned values were current at the time
/// the read succeeded, but prevents reads from succeeding if the network is unavailable for
/// any reason.
///
ReadNetworkOnly
}
/// Native response status codes
/// These values are returned by the native SDK API.
/// NOTE: These values are different than the CommonStatusCodes.
///
public enum ResponseStatus
{
/// The operation was successful.
Success = 1,
/// The operation was successful, but the device's cache was used.
SuccessWithStale = 2,
/// The application is not licensed to the user.
LicenseCheckFailed = -1,
/// An internal error occurred.
InternalError = -2,
/// The player is not authorized to perform the operation.
NotAuthorized = -3,
/// The installed version of Google Play services is out of date.
VersionUpdateRequired = -4,
/// Timed out while awaiting the result.
Timeout = -5,
///< summary>
/// Constant indicating that the developer does not have access to the friends list, but can
/// call the AskForLoadFriendsResolution API to show a consent dialog.
///
ResolutionRequired = -6,
}
/// Native response status codes for UI operations.
/// These values are returned by the native SDK API.
///
public enum UIStatus
{
/// The result is valid.
Valid = 1,
/// An internal error occurred.
InternalError = -2,
/// The player is not authorized to perform the operation.
NotAuthorized = -3,
/// The installed version of Google Play services is out of date.
VersionUpdateRequired = -4,
/// Timed out while awaiting the result.
Timeout = -5,
/// UI closed by user.
UserClosedUI = -6,
UiBusy = -12,
/// An network error occurred.
NetworkError = -20,
}
/// Values specifying the start location for fetching scores.
public enum LeaderboardStart
{
/// Start fetching scores from the top of the list.
TopScores = 1,
/// Start fetching relative to the player's score.
PlayerCentered = 2,
}
/// Values specifying which leaderboard timespan to use.
public enum LeaderboardTimeSpan
{
/// Daily scores. The day resets at 11:59 PM PST.
Daily = 1,
/// Weekly scores. The week resets at 11:59 PM PST on Sunday.
Weekly = 2,
/// All time scores.
AllTime = 3,
}
/// Values specifying which leaderboard collection to use.
public enum LeaderboardCollection
{
/// Public leaderboards contain the scores of players who are sharing their gameplay publicly.
Public = 1,
/// Social leaderboards contain the scores of players in the viewing player's circles.
Social = 2,
}
public enum FriendsListVisibilityStatus
{
///< summary>
/// Constant indicating that currently it's unknown if the friends list is visible to the
/// game, game can ask for permission from user.
///
Unknown = 0,
/// Constant indicating that the friends list is currently visible to the game.
Visible = 1,
///< summary>
/// Constant indicating that the developer does not have access to the friends list, but can
/// call the AskForLoadFriendsResolution API to show a consent dialog.
///
ResolutionRequired = 2,
///< summary>
/// Constant indicating that the friends list is currently unavailable for this user, and it
/// is not possible to request access at this time, either because the user has permanently
/// declined or the friends feature is not available to them. In this state, any attempts to
/// request
/// access to the friends list will be unsuccessful.
///
Unavailable = 3,
/// An network error occurred.
NetworkError = -4,
/// The player is not authorized to perform the operation.
NotAuthorized = -5,
}
public enum LoadFriendsStatus
{
/// An unknown value to return when loadFriends is not available.
Unknown = 0,
/// All the friends have been loaded.
Completed = 1,
/// There are more friends to load.
LoadMore = 2,
///
/// The game doesn't have permission to access the player's friends list. No friends loaded.
///
ResolutionRequired = -3,
/// An internal error occurred.
InternalError = -4,
/// The player is not authorized to perform the operation.
NotAuthorized = -5,
/// An network error occurred.
NetworkError = -6,
}
public enum VideoCaptureMode
{
/// An unknown value to return when capture mode is not available.
Unknown = -1,
/// Capture device audio and video to a local file.
File = 0,
/// Capture device audio and video, and stream it live.
/// Not currently supported in the Unity Plugin.
Stream = 1 // Not currently supported in the Unity Plugin.
}
public enum VideoQualityLevel
{
/// An unknown value to return when quality level is not available.
Unknown = -1,
/// SD quality: Standard def resolution (e.g. 480p) and a low bit rate (e.g. 1-2Mbps).
SD = 0,
/// HD quality: DVD HD resolution (i.e. 720p) and a medium bit rate (e.g. 3-4Mbps).
HD = 1,
/// Extreme HD quality: BluRay HD resolution (i.e. 1080p) and a high bit rate (e.g. 6-8Mbps).
XHD = 2,
/// Full HD quality: 2160P resolution and high bit rate, e.g. 10-12Mbps.
FullHD = 3
}
public enum VideoCaptureOverlayState
{
/// State used to indicate that the state of the capture overlay is unknown.
/// This usually indicates an error.
Unknown = -1,
/// State used to indicate that the capture overlay is drawn on the screen and visible to the user.
Shown = 1,
/// State used to indicate that the user has initiated capture via the capture overlay.
Started = 2,
/// State used to indicate that the user has stopped capturing via the capture overlay.
Stopped = 3,
/// State used to indicate that the user has dismissed the capture overlay and it is no longer visible.
Dismissed = 4
}
public enum Gravity
{
TOP = 48,
BOTTOM = 80,
LEFT = 3,
RIGHT = 5,
CENTER_HORIZONTAL = 1
}
public class CommonTypesUtil
{
public static bool StatusIsSuccess(ResponseStatus status)
{
return ((int) status) > 0;
}
}
}