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

📄 graph.java

📁 java Labyrinth game;Provides two kinds to produce map s way stochastically: The stochastic distribut
💻 JAVA
字号:
package src;

import java.util.LinkedList;
/*
 * 图,用于产生一个图而深处优先遍历产生地图
 */
public class Graph {
	private int thisCode;
	private int stateOf=0;//用来标记元素的个数
	LinkedList<Integer> conCode = new LinkedList<Integer>();//采用邻接表存储邻接点
	XandY xandyInGraph = new XandY();
	boolean vistied = false;
	public void setxandyInGraph(int x,int y){
		xandyInGraph.setX(x);
		xandyInGraph.setY(y);
	}
	public XandY getxandyInGraph(){
		return xandyInGraph;
	}
	public void addLink(Integer x){
		/*
		 * 从起始点加入是为了可以用stateOf直接调用未被访问的元素
		 */
		conCode.offerFirst(x);
		stateOf++;
	}
	public int getstateOf(){
		return stateOf;
	}
	public int getLink(int k){
			return conCode.get(k);
	}
	public Graph(int thisCode){//构造函数
		this.thisCode=thisCode;
	}
	public void setthisCode(int thisCode){
		this.thisCode=thisCode;
	}
	public int getthisCode(){
		return thisCode;
	}
	public void setvistied(){
		vistied = true;
	}
}


⌨️ 快捷键说明

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