VOGameManagerProtocol
@protocol VOGameManagerProtocol <NSObject>
VOGameManagerProtocol
is the interface for all game related network requests.
See VOGameManager
for the default implementation of the interface.
-
An array of
VOGameData
s representing all possible games this client can play.Declaration
Objective-C
@property (readonly, strong, nonatomic) NSArray<VOGameData *> *gameDatas;
Swift
var gameDatas: [VOGameData]! { get }
-
Requests all the
VOGameData
s this client can play from a Server.Declaration
Objective-C
- (void)requestGamesWithSuccess:(void (^)(NSArray<VOGameData *> *))onSuccess failure:(void (^)(NSError *))onFail;
Swift
func requestGames(success onSuccess: (([VOGameData]?) -> Void)!, failure onFail: ((Error?) -> Void)!)
Parameters
onSuccess
- Block to be called when the request completes successfully.
onFail
- Block to be called when the requests completes with an error.
-
Declaration
Objective-C
- (void)addGameScoreWithVoucherUri:(NSString *)voucherUri score:(NSInteger)score previousScore:(NSInteger)previousScore success:(void (^)(void))onSuccess failure:(void (^)(NSError *))onFail;
Swift
func addGameScore(withVoucherUri voucherUri: String!, score: Int, previousScore: Int, success onSuccess: (() -> Void)!, failure onFail: ((Error?) -> Void)!)
Parameters
voucherUri
- The uri of the
VOVoucher
that should be updated.score
- The score the
VOUser
achieved.previousScore
- The previous high score of the
VOVoucher
.onSuccess
- Block to be called when the request completes successfully.
onFail
- Block to be called when the request completes with an error.