public class EatDataController
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
static interface |
EatDataController.OnUploadListener |
限定符和类型 | 方法和说明 |
---|---|
void |
addDownloadListener(FoodDownloadListener listener)
供调用者监听资源下载过程
|
void |
downloadFoodZip(java.lang.String zipUrl,
FoodDownloadListener listener)
下载食物资源的zip包(包含image文件),并解压
|
java.util.List<FoodEntity.FoodBean> |
getAllFoodList() |
java.util.List<FoodEntity.FoodBean> |
getDefaultFoodList()
获取默认食物列表
|
java.lang.String |
getFileMD5() |
FoodEntity.FoodBean |
getFoodBeanById(java.lang.String foodId)
根据食物id获取数据对象
|
java.util.List<java.lang.String> |
getFoodImagePath(java.lang.String foodId)
根据食物id查找对应的图片资源路径
|
int |
getGameDuration() |
EatGameOverMessage.Result |
getGameOverResult() |
java.lang.String |
getGameZipUrl() |
boolean |
getGenerateSuccess() |
static EatDataController |
getInstance() |
EatGameShareMessage.Result |
getShareUrlGeneratedResult() |
int |
getUploadProgress() |
com.app.shortvideo.presenter.VidInfo |
getUploadVidInfo() |
boolean |
isDownloading() |
boolean |
isDownloading(java.lang.String url) |
boolean |
isFoodExisted()
判断食物资源包是否存在,必须每个食物的资源文件都存在才返回true
|
boolean |
isFoodExisted(FoodEntity.FoodBean foodBean)
判断指定食物资源是否存在
|
boolean |
isIsRequestShareUrlFinished() |
boolean |
isIsUploadFinished() |
boolean |
isNeedSaveLocalVideo() |
boolean |
isUploadSuccess() |
void |
onDestroy() |
void |
onShareUrlGenerated(EatGameShareMessage.Result result) |
void |
onUploadProgress(int progress) |
void |
onUploadResult(boolean success) |
void |
removeDownloadListener(FoodDownloadListener listener)
移除资源下载监听
|
void |
requestFoodList(com.app.common.common.AsyncActionCallback callback)
查询主播端的食物列表
|
void |
requestGameCheck(com.app.common.common.AsyncActionCallback callback,
java.lang.String vid,
java.lang.String httpMsgTag)
检查游戏的限制条件
|
void |
requestGameOver(com.app.common.common.AsyncActionCallback callback,
java.lang.String vid,
java.lang.String score)
主播端结束游戏
|
void |
requestGameStart(com.app.common.common.AsyncActionCallback callback,
java.lang.String vid)
主播端开始游戏
|
void |
reset() |
void |
resetUploadStatus() |
void |
setEatGameOverResult(EatGameOverMessage.Result result) |
void |
setGenerateSuccess(boolean generateSuccess) |
void |
setNeedSaveLocalVideo(boolean needSaveLocalVideo) |
void |
setOnUploadListener(EatDataController.OnUploadListener l) |
void |
setUploadVidInfo(com.app.shortvideo.presenter.VidInfo vidInfo) |
void |
traversalFoodFolder() |
void |
updateFoodList(EatGameFoodListMessage.Result result)
更新食物列表数据
|
public static EatDataController getInstance()
public void onDestroy()
public int getGameDuration()
public java.lang.String getGameZipUrl()
public java.util.List<FoodEntity.FoodBean> getAllFoodList()
public java.util.List<FoodEntity.FoodBean> getDefaultFoodList()
public void requestFoodList(com.app.common.common.AsyncActionCallback callback)
callback
- public void requestGameStart(com.app.common.common.AsyncActionCallback callback, java.lang.String vid)
callback
- vid
- public void requestGameOver(com.app.common.common.AsyncActionCallback callback, java.lang.String vid, java.lang.String score)
callback
- vid
- score
- public void requestGameCheck(com.app.common.common.AsyncActionCallback callback, java.lang.String vid, java.lang.String httpMsgTag)
callback
- vid
- httpMsgTag
- public void updateFoodList(EatGameFoodListMessage.Result result)
result
- public java.lang.String getFileMD5()
public void downloadFoodZip(java.lang.String zipUrl, FoodDownloadListener listener)
listener
- public void addDownloadListener(FoodDownloadListener listener)
listener
- public void removeDownloadListener(FoodDownloadListener listener)
listener
- public boolean isFoodExisted(FoodEntity.FoodBean foodBean)
foodBean
- public boolean isFoodExisted()
public boolean isDownloading(java.lang.String url)
public boolean isDownloading()
public void traversalFoodFolder()
public java.util.List<java.lang.String> getFoodImagePath(java.lang.String foodId)
foodId
- public FoodEntity.FoodBean getFoodBeanById(java.lang.String foodId)
foodId
- public void onShareUrlGenerated(EatGameShareMessage.Result result)
public void onUploadProgress(int progress)
public void onUploadResult(boolean success)
public EatGameShareMessage.Result getShareUrlGeneratedResult()
public int getUploadProgress()
public boolean isUploadSuccess()
public boolean isIsUploadFinished()
public boolean isIsRequestShareUrlFinished()
public void reset()
public void resetUploadStatus()
public void setNeedSaveLocalVideo(boolean needSaveLocalVideo)
public boolean isNeedSaveLocalVideo()
public void setUploadVidInfo(com.app.shortvideo.presenter.VidInfo vidInfo)
public com.app.shortvideo.presenter.VidInfo getUploadVidInfo()
public void setEatGameOverResult(EatGameOverMessage.Result result)
public EatGameOverMessage.Result getGameOverResult()
public void setGenerateSuccess(boolean generateSuccess)
public boolean getGenerateSuccess()
public void setOnUploadListener(EatDataController.OnUploadListener l)