comparator.java
来自「用J2ME开发的俄罗斯方块」· Java 代码 · 共 23 行
JAVA
23 行
package tetris;
import javax.microedition.rms.RecordComparator;
import tetris.Account;
public class Comparator implements RecordComparator{
public int compare(byte[] rec1, byte[] rec2) {
Account a1 = Account.decode(rec1);
int f1=a1.getFenshu();
Account a2 = Account.decode(rec2);
int f2=a2.getFenshu();
if(f1>f2){
return 1;
}else if(f1<f2){
return -1;
}
return 0;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?