Revision 967b79dc
Added by Leszek Koltunski almost 3 years ago
src/main/java/org/distorted/helpers/BlockController.java | ||
---|---|---|
47 | 47 |
|
48 | 48 |
private static final long THRESHHOLD_0 = 3000; |
49 | 49 |
private static final long THRESHHOLD_1 = 25000; |
50 |
private static final long THRESHHOLD_2 = 45000; |
|
50 | 51 |
|
51 | 52 |
private static long mPauseTime, mResumeTime; |
52 | 53 |
|
... | ... | |
96 | 97 |
|
97 | 98 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
98 | 99 |
// RUBIK_PLACE_3 and TUTORIAL_PLACE_3 are scrambles, those can take up to 20 seconds. |
100 |
// CONTROL_PLACE_* are the visual tutorials, could take up to 45 seconds. |
|
101 |
|
|
102 |
private long getThreshhold(int last) |
|
103 |
{ |
|
104 |
switch(last) |
|
105 |
{ |
|
106 |
case RUBIK_PLACE_3 : |
|
107 |
case TUTORIAL_PLACE_3: return THRESHHOLD_1; |
|
108 |
case CONTROL_PLACE_0 : |
|
109 |
case CONTROL_PLACE_1 : return THRESHHOLD_2; |
|
110 |
default : return THRESHHOLD_0; |
|
111 |
} |
|
112 |
} |
|
113 |
|
|
114 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
99 | 115 |
|
100 | 116 |
private void checkingThread() |
101 | 117 |
{ |
102 | 118 |
long now = System.currentTimeMillis(); |
103 | 119 |
|
104 |
long touchThreshhold = (mLastTouchPlace==RUBIK_PLACE_3 || mLastTouchPlace==TUTORIAL_PLACE_3) ? THRESHHOLD_1 : THRESHHOLD_0;
|
|
120 |
long touchThreshhold = getThreshhold(mLastTouchPlace);
|
|
105 | 121 |
|
106 | 122 |
if( mTouchBlockTime>mPauseTime && now-mTouchBlockTime>touchThreshhold ) |
107 | 123 |
{ |
... | ... | |
116 | 132 |
reportTouchProblem(touchThreshhold); |
117 | 133 |
} |
118 | 134 |
|
119 |
long uiThreshhold = (mLastUIPlace==RUBIK_PLACE_3 || mLastUIPlace==TUTORIAL_PLACE_3) ? THRESHHOLD_1 : THRESHHOLD_0;
|
|
135 |
long uiThreshhold = getThreshhold(mLastUIPlace);
|
|
120 | 136 |
|
121 | 137 |
if( mUIBlockTime>mPauseTime && now-mUIBlockTime>uiThreshhold ) |
122 | 138 |
{ |
Also available in: Unified diff
Progress with RubikControl.