⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mbacsystem.java

📁 一个贪吃蛇游戏
💻 JAVA
字号:
/**
 * @(#)MBACSystem.java
 * @The system of all the permanent information.
 *
 * @Link Scholes
 * @version 1.00 2008/7/21
 */

package System;

import Data.*;

public class MBACSystem
{
	private Map map;
	private MapList mapList;
	private Score score;
	
	//construct a system with all things defaulted
	public MBACSystem()
	{
		map = new Map();
		mapList = new MapList();
		score = new Score();
	}
	
	//get the dificulty of the current map
	public int getMapDifficulty()
	{
		return map.getDifficulty();
	}
	
	//get the proportions of four kinds of food of the current map
	public int[] getMapFood()
	{
		return map.getFood();
	}
	
	//get the info of the current map
	public int[][] getMapInfo()
	{
		return map.getInfo();
	}
	
	//get the name of the current map
	public String getMapName()
	{
		return map.getName();
	}
	
	//set the current map with specified name,info and proportions of four kinds of food
	public void setMap(String s,int a[][],int b[])
	{
		map.setMap(s,a,b);
	}
	
	//save the current map
	public void saveMap()
	{
		map.save();
		mapList.addMap(map.getName());
	}
	
	//load the map with specified kind(original/extended) and name
	public void loadMap(boolean b,String s)
	{
		map.load(b,s);
	}
	
	//get the current map list
	public String[] getList()
	{
		return mapList.getList();
	}
	
	//return whether the current map list contains the specifed map
	public boolean hasMap(String s)
	{
		return mapList.hasMap(s);
	}
	
	//get the rankings of specified kind(normal/survival)
	public String[] getRankings(boolean b)
	{
		return score.getRankings(b);
	}
	
	//get the temporary ranking of the specified score in the specified kind(normal/survival)
	public int getTempRanking(boolean b,int n)
	{
		return score.getTempRanking(b,n);
	}
	
	//update the ranking with specified kind(normal/survival),player name,map name/stage and score
	public void update(boolean b,String s,String t,int n)
	{
		score.update(b,s,t,n);
	}
	
	//reset the ranking with defaulted value
	public void reset()
	{
		score.reset();
	}
}	//end class MBACSystem

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -