Hello everyone :) I lately started learning C# and wanted to create minesweeper game. I had pattern, done before in C++ and Java ( just console ) and it seemed to be fine in C# as well.
But there is an error I can't get rid of.
Warning CS0649 Field 'Minefield.field' is never assigned to, and will always have its default value null
Here is part of code I have trouble with:
struct Field
{
public int mine;
public int mines_around;
public State status;
};
class Minefield
{
Random rand = new Random();
const int Rows = 10;
const int Columns = 10;
Field[][] field;
int Difficulty;
public Minefield(int Diff)//from 1 to 10
I've seen there is way of creating arrays like Field[,] field = new Field[10,10] But as I tried it the same error occured. Any ideas from more experienced C# programmers ?