📄 shapefactory.java
字号:
import java.util.Random;
public class ShapeFactory
{
private int[][][] shapes =
{
{
{
1,0,0,0,
1,1,1,0 ,
0,0,0,0 ,
0,0,0,0
},
{
1,1,0,0,
1,0,0,0,
1,0,0,0,
0,0,0,0
},
{
1,1,1,0,
0,0,1,0,
0,0,0,0,
0,0,0,0
},
{
0,1,0,0,
0,1,0,0,
1,1,0,0,
0,0,0,0
}
}
};
public Shape getShape(ShapeListener lis)
{
System.out.println("getShape()");
Shape shape = new Shape();
int type = new Random().nextInt(shapes.length);
shape.setBody(shapes[type]);
shape.setStatus(new Random().nextInt(4));
shape.addListener(lis);
return shape;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -