Class GamePresenter<T extends GameView>
- java.lang.Object
-
- com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter<V>
-
- com.cheetahdigital.uikit.architecture.mvp.Presenter<T>
-
- com.cheetahdigital.challenges.ui.responses.base.ChallengeResponsePresenter<T>
-
- com.cheetahdigital.challenges.ui.responses.game.base.GamePresenter<T>
-
- Type Parameters:
T
- instance ofGameView
- All Implemented Interfaces:
MvpPresenter<T>
- Direct Known Subclasses:
HtmlGamePresenter
,ScratcherPresenter
public abstract class GamePresenter<T extends GameView> extends ChallengeResponsePresenter<T>
Base presenter for Games
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
mGameError
protected Response
mGameResult
protected Prize
mPrize
protected java.util.List<Prize>
mPrizes
-
Constructor Summary
Constructors Constructor Description GamePresenter(java.lang.String id, java.lang.String responseId, ChallengeParams params, ChallengeFields fields, Challenge challenge)
GamePresenter(java.lang.String id, java.lang.String responseId, Challenge challenge)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
getGameResult()
Request game result from the server by submitting a challenge responseabstract void
init()
Call to initialize the gameprotected void
onRespondFailed(java.lang.String error)
Show challenge response error messageprotected void
onRespondSuccess(Response data)
Notify the view that the challenge response is successfulvoid
showGameResult()
Show the game result (win / lose / error)-
Methods inherited from class com.cheetahdigital.challenges.ui.responses.base.ChallengeResponsePresenter
getChallengesAPI, getRespondListener, submitChallengeResponse, submitChallengeResponse, submitChallengeResponse, submitChallengeResponse, submitChallengeResponse, submitChallengeResponse
-
Methods inherited from class com.cheetahdigital.uikit.architecture.mvp.MvpNullObjectBasePresenter
attachView, detachView, getView
-
-
-
-
Constructor Detail
-
GamePresenter
public GamePresenter(java.lang.String id, java.lang.String responseId, Challenge challenge)
-
GamePresenter
public GamePresenter(java.lang.String id, java.lang.String responseId, ChallengeParams params, ChallengeFields fields, Challenge challenge)
-
-
Method Detail
-
init
public abstract void init()
Call to initialize the game
-
getGameResult
public void getGameResult()
Request game result from the server by submitting a challenge response
-
onRespondSuccess
protected void onRespondSuccess(Response data)
Description copied from class:ChallengeResponsePresenter
Notify the view that the challenge response is successful- Overrides:
onRespondSuccess
in classChallengeResponsePresenter<T extends GameView>
- Parameters:
data
- theResponse
-
onRespondFailed
protected void onRespondFailed(java.lang.String error)
Description copied from class:ChallengeResponsePresenter
Show challenge response error message- Overrides:
onRespondFailed
in classChallengeResponsePresenter<T extends GameView>
- Parameters:
error
- message
-
showGameResult
public void showGameResult()
Show the game result (win / lose / error)
-
-