📄 convertballadversity.java
字号:
package org.bubblebreaker.model;
import java.util.*;
public class ConvertBallAdversity extends ModelEventListener{
Timer timer=new Timer();
Random random =new Random();
//Every fixed time interval convert a ball
public ConvertBallAdversity(int timeIntervalInSec)
{
timer.scheduleAtFixedRate(new ConvertBallTask(),0,timeIntervalInSec*1000);
}
public void stop()
{
if(null!=timer)
timer.cancel();
}
class ConvertBallTask extends java.util.TimerTask{
public void run()
{
random.nextInt();
//choose a random cell and convert it
//
/*
redrawCells();
if(model.currentBoard.selectedCells!=null)
{
int size=model.currentBoard.selectedCells.length;
for(int i=0;i<size;i++)
{
Cell cell=model.currentBoard.selectedCells[i];
blinkBall(cell);
}
}else
{
Cell cell=model.currentBoard.currentCell;
blinkBall(cell);
}
flushGraphics();
blinkStateShow=!blinkStateShow;
*/
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -