Jetzt klappt erst mal alles! Ich weiß wohl doch mehr als ich mir zu traue..
Danke Leute!
MfG New2Java
PHP:
public class Area
{
private int id;
private String name;
private String description;
private Room room;
private String[][] Room[][];
Room[][] r;
public Area(int id, String name, String description)
{
this.id = id;
this.name = name;
this.description = description;
int n = 4;
r = new Room[n][n];
int c = 1;
for (int i=0; i < n; i++)
{
for (int j=0; j < n; j++)
{ c=i*4+j+1;
r[i][j] = new Room(0, "name", "description", i, j, c);
}
}
}
public int id() {return id;}
public String name() {return name;}
public String description() {return description;}
public void look()
{
int n = 4;
int c = 1;
for (int i=0; i < n; i++)
{
for (int j=0; j < n; j++, c++)
{
System.out.println(r[i][j].toString());
}
System.out.println();
}
}
}
Danke Leute!
MfG New2Java