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
VOVoucherCreationFlowDelegateused 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
VOVoucherCreationFlowDelegateif one is provided. Otherwise, one will be instantiated based on the provided VOGameData.Note
This method will throwGameViewControllerNotFoundExceptionif 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
VOGameDatathat 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
VOGameModefor the different options.Return Value
Instance of a UIViewController that implements
GameViewControllerProtocolfor the providedVOGameData.
View on GitHub
VOGameFactory Class Reference