MCPcopy Create free account
hub / github.com/TanaStudy/Java-Study / clear

Method clear

8. Demo/Java/src/main/LeetCode/Tetris/Main.java:195–208  ·  view source on GitHub ↗
(int m, int n)

Source from the content-addressed store, hash-verified

193 }
194 /*清除方块掉落之前有颜色的地方*/
195 public void clear(int m, int n) {
196 int temp = 0x8000;//表示1000 0000 0000 0000
197 for (int i = 0; i < 4; i++) {//循环遍历16个方格(4*4)
198 for (int j = 0; j < 4; j++) {
199 if ((temp & rect) != 0) {// 此处有方块时
200 grids[m][n].setBackground(Color.WHITE);//清除颜色,变为白色
201 }
202 n++;//下一列
203 temp >>= 1;
204 }
205 m++;//下一行
206 n = n - 4;//回到首列
207 }
208 }
209 /*绘制掉落后方块图像*/
210 public void draw(int m, int n) {
211 int temp = 0x8000;//表示1000 0000 0000 0000

Callers 15

fallMethod · 0.95
keyTypedMethod · 0.95
bootstrap.min.jsFile · 0.80
SeFunction · 0.80
vue.min.jsFile · 0.80
XeFunction · 0.80
rFunction · 0.80
SFunction · 0.80
EFunction · 0.80
iFunction · 0.80
_Function · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected