public abstract class BaseDoodlePadDataMgr extends java.lang.Object implements IDoodlePadData
限定符和类型 | 字段和说明 |
---|---|
protected static java.lang.String |
DOODLE_JSON_KEY |
protected static java.lang.String |
DOODLE_JSON_VALUE |
protected DoodleDataReportStatistics |
mDataReportStatistics |
protected DoodlePad |
mDoodleFragment |
protected android.util.SparseArray<java.lang.String> |
mDrawQueue |
protected java.lang.String |
mGameId |
protected android.os.Handler |
mHandler |
protected static long |
MIN_TIME_INTERVAL |
protected boolean |
mIsReporting |
protected int |
mLastReceiveDoodlePosition |
protected long |
mLastReportTime |
protected java.util.concurrent.atomic.AtomicInteger |
mReportDoodlePosition |
protected android.util.SparseArray<java.lang.String> |
mReportQueue |
protected java.lang.String |
mVid |
构造器和说明 |
---|
BaseDoodlePadDataMgr(DoodlePad doodlePadFragment) |
限定符和类型 | 方法和说明 |
---|---|
protected abstract void |
addReceiveData(java.util.ArrayList<DoodlePadDataInfo> list)
添加收到的画笔数据
|
protected abstract void |
addReceiveData(int position,
java.lang.String json)
添加收到的画笔数据
|
protected abstract void |
addReportData(java.lang.String json)
添加待上报的画笔数据,画笔数据回调时调用
|
protected abstract java.lang.String |
buildReportContent()
构造上报参数
|
protected abstract void |
checkNextDraw() |
protected void |
checkNextReport() |
protected void |
clearDrawQueue() |
protected void |
clearReportQueue() |
boolean |
getCanReport() |
protected java.lang.String |
getCurrentClassName() |
protected java.lang.String |
getSyncType() |
protected boolean |
isActivityAlive() |
protected void |
log(java.lang.String message) |
void |
onDoodlePadReady(int currentGameStep)
画板准备完毕
|
void |
onDrawBegin(java.lang.String drawingUid,
boolean isVCalling)
绘制阶段开始
|
void |
onDrawEnd(java.lang.String drawingUid,
boolean isVCalling)
绘制阶段结束
|
void |
onGameEnd()
游戏结束
|
void |
onGameStart()
游戏开始
|
protected abstract void |
onReportStrokeSuccess(java.lang.String json)
画笔数据上报成功,累计本次上报的画笔数量
|
protected abstract void |
putReportFailedData(java.lang.String jsonArrayData)
上报失败时重新加入上报队列
|
void |
reportData(java.lang.String json)
画板数据上报
|
protected void |
reset()
绘制开始或者游戏结束时重置相关数据
|
void |
setCanReport(boolean canReport) |
void |
setCommonData(java.lang.String vid,
DrawingGameProgressInfo gameInfo) |
void |
setDoodleFragment(DoodlePad doodleFragment) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
drawData, syncData
protected static final java.lang.String DOODLE_JSON_KEY
protected static final java.lang.String DOODLE_JSON_VALUE
protected static final long MIN_TIME_INTERVAL
protected boolean mIsReporting
protected long mLastReportTime
protected DoodlePad mDoodleFragment
protected java.lang.String mVid
protected java.lang.String mGameId
protected java.util.concurrent.atomic.AtomicInteger mReportDoodlePosition
protected android.os.Handler mHandler
protected android.util.SparseArray<java.lang.String> mReportQueue
protected int mLastReceiveDoodlePosition
protected android.util.SparseArray<java.lang.String> mDrawQueue
protected final DoodleDataReportStatistics mDataReportStatistics
public BaseDoodlePadDataMgr(DoodlePad doodlePadFragment)
public void setCommonData(java.lang.String vid, DrawingGameProgressInfo gameInfo)
public void setDoodleFragment(DoodlePad doodleFragment)
public void setCanReport(boolean canReport)
public boolean getCanReport()
protected boolean isActivityAlive()
public void reportData(java.lang.String json)
reportData
在接口中 IDoodlePadData
json
- protected java.lang.String getSyncType()
protected void clearReportQueue()
protected void clearDrawQueue()
protected java.lang.String getCurrentClassName()
protected void log(java.lang.String message)
public void onGameStart()
IDoodlePadData
onGameStart
在接口中 IDoodlePadData
public void onGameEnd()
IDoodlePadData
onGameEnd
在接口中 IDoodlePadData
public void onDrawBegin(java.lang.String drawingUid, boolean isVCalling)
IDoodlePadData
onDrawBegin
在接口中 IDoodlePadData
public void onDrawEnd(java.lang.String drawingUid, boolean isVCalling)
IDoodlePadData
onDrawEnd
在接口中 IDoodlePadData
public void onDoodlePadReady(int currentGameStep)
IDoodlePadData
onDoodlePadReady
在接口中 IDoodlePadData
protected void reset()
protected void checkNextReport()
protected abstract java.lang.String buildReportContent()
protected abstract void putReportFailedData(java.lang.String jsonArrayData)
protected abstract void checkNextDraw()
protected abstract void addReportData(java.lang.String json)
protected abstract void addReceiveData(int position, java.lang.String json)
protected abstract void addReceiveData(java.util.ArrayList<DoodlePadDataInfo> list)
protected abstract void onReportStrokeSuccess(java.lang.String json)