VOGameFactory
@interface VOGameFactory : NSObject
VOGameFactory
produces UIViewControllers that conform to GameViewControllerProtocol
for the specified types.
VOGameFactory
communicates with the VOVoucherCreationFlowDelegate
and delegates outside the SDK if necessary.
-
Default initializer of VOGameFactory.
Declaration
Objective-C
- (nonnull instancetype)initWithDelegate: (nonnull id<VOVoucherGameDelegate>)delegate;
Parameters
delegate
- The
VOVoucherCreationFlowDelegate
used to communicate with external objects (outside the SDK).Return Value
Instance of VOGameFactory.
-
This method is to be called whenever a game view controller is required. This method will return a game view controller from the
VOVoucherCreationFlowDelegate
if one is provided. Otherwise, one will be instantiated based on the provided VOGameData.Note
This method will throwGameViewControllerNotFoundException
if no view controller is found for theVOGameData
.Declaration
Objective-C
- (nullable UIViewController<VOGameViewControllerProtocol> *) viewControllerForGameData:(nonnull VOGameData *)gameData vouchrTheme:(nonnull VOTheme *)vouchrTheme dialogViewTheme:(nonnull VOTheme *)dialogViewTheme loadingView:(nullable id<VOLoadingViewProtocol>)loadingView user:(nullable VOUser *)user gameMode:(VOGameMode)gameMode;
Parameters
gameData
- The
VOGameData
that will be used in the game view controller.vouchrTheme
- The theme for the game view controller.
loadingView
- A loading view if the game view controller needs to show loading.
user
- The creator of the
VOGameData
.gameMode
- The current mode of the game. See
VOGameMode
for the different options.Return Value
Instance of a UIViewController that implements
GameViewControllerProtocol
for the providedVOGameData
.