Revision 27a70eae
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/effect/win/WinEffect.java | ||
---|---|---|
24 | 24 |
import org.distorted.library.main.DistortedEffects; |
25 | 25 |
import org.distorted.library.main.DistortedScreen; |
26 | 26 |
import org.distorted.library.message.EffectListener; |
27 |
import org.distorted.object.RubikCube; |
|
28 | 27 |
import org.distorted.magic.RubikRenderer; |
28 |
import org.distorted.object.RubikObject; |
|
29 | 29 |
|
30 | 30 |
import java.lang.reflect.Method; |
31 | 31 |
|
... | ... | |
67 | 67 |
private int mEffectReturned; |
68 | 68 |
private int mCubeEffectNumber, mNodeEffectNumber; |
69 | 69 |
|
70 |
RubikCube mCube;
|
|
70 |
RubikObject mObject;
|
|
71 | 71 |
DistortedScreen mScreen; |
72 | 72 |
Effect[] mCubeEffects; |
73 | 73 |
int[] mCubeEffectPosition; |
... | ... | |
92 | 92 |
|
93 | 93 |
for(int i=0; i<mCubeEffectNumber; i++) |
94 | 94 |
{ |
95 |
mCube.apply(mCubeEffects[i],mCubeEffectPosition[i]);
|
|
95 |
mObject.apply(mCubeEffects[i],mCubeEffectPosition[i]);
|
|
96 | 96 |
mCubeEffects[i].notifyWhenFinished(this); |
97 | 97 |
} |
98 | 98 |
|
99 |
DistortedEffects nodeEffects = mCube.getEffects();
|
|
99 |
DistortedEffects nodeEffects = mObject.getEffects();
|
|
100 | 100 |
|
101 | 101 |
for(int i=0; i<mNodeEffectNumber; i++) |
102 | 102 |
{ |
... | ... | |
143 | 143 |
if( effectID == id ) |
144 | 144 |
{ |
145 | 145 |
if( ++mEffectReturned == total ) mListener.effectFinished(FAKE_EFFECT_ID); |
146 |
mCube.remove(id);
|
|
146 |
mObject.remove(id);
|
|
147 | 147 |
return; |
148 | 148 |
} |
149 | 149 |
} |
... | ... | |
154 | 154 |
if( effectID == id ) |
155 | 155 |
{ |
156 | 156 |
if( ++mEffectReturned == total ) mListener.effectFinished(FAKE_EFFECT_ID); |
157 |
mCube.getEffects().abortById(id);
|
|
157 |
mObject.getEffects().abortById(id);
|
|
158 | 158 |
return; |
159 | 159 |
} |
160 | 160 |
} |
... | ... | |
166 | 166 |
public long start(int duration, RubikRenderer renderer) |
167 | 167 |
{ |
168 | 168 |
mScreen = renderer.getScreen(); |
169 |
mCube = renderer.getCube();
|
|
169 |
mObject = renderer.getObject();
|
|
170 | 170 |
mListener = renderer; |
171 | 171 |
mDuration = duration; |
172 | 172 |
|
Also available in: Unified diff
Make RubikCube and RubikCubeMovement generic and not visible outside of their package.