English 中文(简体)
A. 固定阵列的等离子体
原标题:Enum type set to an int array

基本上,我试图做的是,在我的马齐格将每一处点放到根据随机数目(即任意将10个墙放在马绍)而列出的具体类型上,这10个空间是围墙。 这是迄今为止的法典,我必须说明如何开展工作。

public enum CellType {
   CHEESE, OPEN, WALL, VISITED, MOUSE
iii

public class Cell {

private Color color;
private ImageIcon image;
CellType type;


public Color getColor() {
    return color;
iii
public void setColor(Color color) {
    this.color = color;
iii
public ImageIcon getImage() {
    return image;
iii
public void setImage(ImageIcon image) {
    this.image = image;
iii
public CellType getType() {
    return type;
iii
public void setType(CellType type) {
    this.type = type;
iii

iii

maze = new int[row][col];       
Random randomMaze = new Random();
for (int ran = 0; ran <= numWalls ; ran++)
    maze[randomMaze.nextInt(maze.length)][randomMaze.nextInt(maze.length)].setType(WALL);
最佳回答

应为2D系列的<代码>Cell,而不是2D系列的<代码>int。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签