F
Fencer
Hello, if I want to create 2D-array of ints I can do:
int[,] ints = {{1, 2, 3}, {4, 5, 6}};
However, when I try the same thing for the type Tile, which is a class
I've written:
Tile[,] tiles = {
{new Tile(), new Tile(), new Tile(), new Tile()},
{new Tile(), new Tile(), new Tile(Tile.TileType.WALL), new Tile()},
{new Tile(Tile.TileType.START), new Tile(Tile.TileType.WALL),
new Tile(), new Tile(Tile.TileType.END)}};
I get a TypeInitializationException. I placed a breakpoint at the first
line in the two Tile constructors, but it's not reached before I get
the unhandled exception. How can I make it work?
- Fencer
int[,] ints = {{1, 2, 3}, {4, 5, 6}};
However, when I try the same thing for the type Tile, which is a class
I've written:
Tile[,] tiles = {
{new Tile(), new Tile(), new Tile(), new Tile()},
{new Tile(), new Tile(), new Tile(Tile.TileType.WALL), new Tile()},
{new Tile(Tile.TileType.START), new Tile(Tile.TileType.WALL),
new Tile(), new Tile(Tile.TileType.END)}};
I get a TypeInitializationException. I placed a breakpoint at the first
line in the two Tile constructors, but it's not reached before I get
the unhandled exception. How can I make it work?
- Fencer