?? gameworld.java
字號:
import java.lang.*;
import java.util.*;
import java.io.*;
public class GameWorld extends java.lang.Object implements Serializable
{
static final long serialVersionUID = 501;
public int maze[][][];
public int height; /* aligned with north, direction 0 */
public int width;
public int teamHeadCount;
public int[] myLocation; /* array: {x,y,direction} */
public Vector nuggets; /*
nuggets in a cell are arrays: {x,y}
nuggets on a wall are described by the two
cells the wall separates: {x1,y1,x2,y2} */
public Vector ports; /* port positions; array: {x,y} */
/* constructor: give it a maze to create a gameworld */
public GameWorld(int maze[][][]) {
this.maze = maze;
this.myLocation = new int[] {0,0,0};
this.teamHeadCount = 1;
this.nuggets = new Vector();
this.ports = new Vector();
}
/* another constructor: give it everything except onions */
public GameWorld(int maze[][][], int[] myLocation, int teamHeadCount,
Vector nuggets, Vector ports) {
this.maze = maze;
this.myLocation = new int[] {myLocation[0], myLocation[1], myLocation[2]};
this.teamHeadCount = teamHeadCount;
this.nuggets = (Vector) nuggets.clone();
this.ports = (Vector) ports.clone();
}
} /* end of class GameWorld */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -