im writing a simple chess game with c# and cant figure out what im doing wrong here. Box class represents a square on the board.
public class Board
{
Box[,] boxes;
public Board()
{
Box[,] boxes = new Box[8, 8];
}
public void Setpieces()
{
this.boxes[0, 0].SetEmpty(false);
}
then i create a board Board boxes = new Board();
and call setpieces boxes.Setpieces();
and i get an error saying object reference not set to an instance of an object.
im sure whatever ive done wrong is obvious but ive spent a while trying to figure it out and cant get it, so any help would be appreciated.