Skip to content

Instantly share code, notes, and snippets.

@VincentDondain
Last active July 7, 2016 17:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VincentDondain/edd6cfc7263223176c9a2fa2fd17ec8b to your computer and use it in GitHub Desktop.
Save VincentDondain/edd6cfc7263223176c9a2fa2fd17ec8b to your computer and use it in GitHub Desktop.
[iOS (10,0)]
[BaseType (typeof(GKBasePlayer))]
interface GKCloudPlayer
{
[Static]
[Export ("getCurrentSignedInPlayer:")]
void GetCurrentSignedInPlayer (Action<GKCloudPlayer, NSError> handler);
}
[iOS (10,0)]
[BaseType (typeof(NSObject))]
interface GKGameSession
{
[Export ("identifier")]
string Identifier { get; }
[Export ("title")]
string Title { get; }
[Export ("owner")]
GKCloudPlayer Owner { get; }
[Export ("players")]
GKCloudPlayer[] Players { get; }
[Export ("lastModifiedDate")]
NSDate LastModifiedDate { get; }
[Export ("lastModifiedPlayer")]
GKCloudPlayer LastModifiedPlayer { get; }
[Export ("maxNumberOfConnectedPlayers")]
nint MaxNumberOfConnectedPlayers { get; }
[Export ("badgedPlayers")]
GKCloudPlayer[] BadgedPlayers { get; }
[Static]
[Export ("createSessionInContainer:withTitle:maxConnectedPlayers:completionHandler:")]
void CreateSession (string containerName, string title, nint maxPlayers, Action<GKGameSession, NSError> completionHandler);
[Static]
[Export ("loadSessionsInContainer:completionHandler:")]
void LoadSessions (string containerName, Action<GKGameSession[], NSError> completionHandler);
[Static]
[Export ("loadSessionWithIdentifier:completionHandler:")]
void LoadSession (string identifier, Action<GKGameSession, NSError> completionHandler);
[Static]
[Export ("removeSessionWithIdentifier:completionHandler:")]
void RemoveSession (string identifier, Action<NSError> completionHandler);
[Export ("getShareURLWithCompletionHandler:")]
void GetShareUrl (Action<NSUrl, NSError> completionHandler);
[Export ("loadDataWithCompletionHandler:")]
void LoadData (Action<NSData, NSError> completionHandler);
[Export ("saveData:completionHandler:")]
void SaveData (NSData data, Action<NSData, NSError> completionHandler);
[Export ("setConnectionState:completionHandler:")]
void SetConnectionState (GKConnectionState state, Action<NSError> completionHandler);
[Export ("playersWithConnectionState:")]
GKCloudPlayer[] GetPlayers (GKConnectionState state);
[Export ("sendData:withTransportType:completionHandler:")]
void SendData (NSData data, GKTransportType transport, Action<NSError> completionHandler);
[Export ("sendMessageWithLocalizedFormatKey:arguments:data:toPlayers:badgePlayers:completionHandler:")]
void SendMessage (string key, string[] arguments, NSData data, GKCloudPlayer[] players, bool badgePlayers, Action<NSError> completionHandler);
[Export ("clearBadgeForPlayers:completionHandler:")]
void ClearBadge (GKCloudPlayer[] players, Action<NSError> completionHandler);
[Static]
[Export ("acceptShareURL:handler:")]
void AcceptShareUrl (NSUrl url, Action<NSError> handler);
[Static]
[Export ("addEventListener:")]
void AddEventListener (IGKGameSessionEventListener listener);
[Static]
[Export ("removeEventListener:")]
void RemoveEventListener (IGKGameSessionEventListener listener);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment