1、创建玩家级别类Level.java
1 package com.bdqn; 2 /** 3 * 1.玩家级别类 4 * @author pc 5 * 6 */ 7 public class Level { 8 /** 9 * 级别号 10 */ 11 private int levelNo; 12 /** 13 * 各级别一次输出字符串的长度 14 */ 15 private int strLength; 16 /** 17 * 各级别输出字符串的次数 18 */ 19 private int strTime; 20 /** 21 * 各级别闯关的时间限制 22 */ 23 private int timeLimit; 24 /** 25 * 各级别成功输入一次的得分 26 */ 27 private int perScore; 28 29 public Level() { 30 } 31 /** 32 * 有参数构造赋值 33 * @param levelNo 级别号 34 * @param strLength 各级别一次输出字符串的长度 35 * @param strTime 各级别输出字符串的次数 36 * @param timeLimit 各级别闯关的时间限制 37 * @param perScore 各级别成功输入一次的得分 38 */ 39 public Level(int levelNo, int strLength, int strTime, int timeLimit, 40 int perScore) { 41 this.levelNo = levelNo; 42 this.strLength = strLength; 43 this.strTime = strTime; 44 this.timeLimit = timeLimit; 45 this.perScore = perScore; 46 } 47 public int getLevelNo() { 48 return levelNo; 49 } 50 public void setLevelNo(int levelNo) { 51 this.levelNo = levelNo; 52 } 53 public int getStrLength() { 54 return strLength; 55 } 56 public void setStrLength(int strLength) { 57 this.strLength = strLength; 58 } 59 public int getStrTime() { 60 return strTime; 61 } 62 public void setStrTime(int strTime) { 63 this.strTime = strTime; 64 } 65 public int getTimeLimit() { 66 return timeLimit; 67 } 68 public void setTimeLimit(int timeLimit) { 69 this.timeLimit = timeLimit; 70 } 71 public int getPerScore() { 72 return perScore; 73 } 74 public void setPerScore(int perScore) { 75 this.perScore = perScore; 76 } 77 78 79 }