/**
* 玩家类
* @author Chen.Xiangbo
* @version 1.0 2014-11-18
*/
public class Player {
private int levelNo; //当前玩家级别
private int curScore; //当前级别玩家得分
private long startTime; //当前级别玩家游戏开始时间
private int elapsedTime;//当前玩家已用时间
public Player(){
}
public Player(int levelNo,int curScore,long startTime,int elapsedTime){
this.levelNo=levelNo;
this.curScore=curScore;
this.startTime=startTime;
this.elapsedTime=elapsedTime;
}
/**
* 定义play()方法
*/
public String play(){
Scanner input = new Scanner(System.in); //定义输入器
String in=input.next();
return in;
}
public int getLevelNo(){
return levelNo;
}
public void setLevelNo(int levelNo) {
this.levelNo = levelNo;
}
public int getCurScore() {
return curScore;
}
public void setCurScore(int curScore) {
this.curScore = curScore;
}
public long getStartTime() {
return startTime;
}
public void setStartTime(long startTime) {
this.startTime = startTime;
}
public int getElapsedTime() {
return elapsedTime;
}
public void setElapsedTime(int elapsedTime) {
this.elapsedTime = elapsedTime;
}
}
----------------------------------------------------------------------
package project.quickhit.review2;
/**
* 级别参数类
* @author Chen.Xiangbo
* @version 1.0 2014-11-18
*/
public class LevelParam {
public final static Level levels[]=new Level[6]; //对应6个级别:对应数组
/**
* 静态代码块
*/
static{
levels[0]= new Level(1,2,6,45,5);
levels[1]= new Level(2,3,5,40,10);
levels[2]= new Level(3,4,4,35,15);
levels[3]= new Level(4,5,3,30,25);
levels[4]= new Level(5,6,2,25,40);
levels[5]= new Level(6,7,1,20,100);
}
}
-------------------------------------------------------------------
package project.quickhit.review2;
/**
* 游戏类
* @author Chen.Xiangbo
* @version 1.0 2014-11-18
*/
public class Game {
private Player player;