public bool TryAddTouchQueueChanging(TouchQueue queue, TouchQueueChangingMode changingMode, long time) { TouchQueueInfomation info = FindQueueInfomation(queue); if (info.IsEmpty()) { if (changingMode == TouchQueueChangingMode.TQC_PRESS) { TouchQueueInfomation tqcInfo = new TouchQueueInfomation(queue, changingMode, time); mChangedTouchQueues.AddLast(tqcInfo); return(true); } return(false); } else { if (changingMode == TouchQueueChangingMode.TQC_RELEASE) { Debug.Assert((info.lastChangingMode == TouchQueueChangingMode.TQC_PRESS) || (info.lastChangingMode == TouchQueueChangingMode.TQC_MOVE)); info.releaseTime = time; info.repeatTimes++; } bool changed = (info.lastChangingMode == changingMode); info.lastChangingMode = changingMode; return(changed); } }
public TouchQueueInfomation() { touchQueue = null; releaseTime = 0; lastChangingMode = TouchQueueChangingMode.TQC_NONE; repeatTimes = 0; curState = TouchState.STATE_NONE; }
public TouchQueueInfomation(TouchQueue queue, TouchQueueChangingMode changingMode, long time) { curState = TouchState.STATE_NONE; touchQueue = queue; releaseTime = time; lastChangingMode = changingMode; repeatTimes = 0; if (touchQueue.IsActived()) { curState = TouchState.STATE_TAP; } }