package xuni;
import java.util.Scanner;
public class Game {
Player player;
String[] ops = {"打工中心","我的小窝","你好商店","恢复体力","查看状态"};
boolean flag = false;
/**
* 初始化的方法
*/
public void initial(){
player = new Player();
System.out.println("请输入你的昵称:");
Scanner input = new Scanner(System.in);
player.name = input.next();
}
/**
* 主菜单的操作控制方法
*/
public void startGame(){
Room room = new Room();
Shop shop=new Shop();
do {
Scanner input = new Scanner(System.in);
System.out.println("*************【虚拟人生】**************");
System.out.println("**********玩家可选操作列表**************");
for (int i = 0; i < ops.length; i++) {
System.out.println("\t\t\t" + (i + 1) + "." + ops[i]);
}
System.out.println("\t\t\t"+(ops.length+1)+".中止游戏");
String xuan = null;
do {
System.out.println("请输入你的选择:");
xuan = input.next();
switch (xuan){
case "1":
System.out.println("*******************欢迎来到【打工中心】********************");
player.doWork();
break;
case "2":
System.out.println("*******************欢迎回到【我的小窝】********************");
room.showRoomStatus();
if (room.furnitures == null) {
player.goShopping(room, shop);
}
break;
case "3":
System.out.println("*******************欢迎来到【你好商店】********************");
player.goShopping(room,shop);