Answer the question
In order to leave comments, you need to log in
Error CS0103: The name '$exception' does not exist in the current context?
The following error occurs:
public Column(int column)
{
this.column = column;
Counter = column;
onColumnCreate += new CreateColumn(Cell.Re_Linked_atColumn);
for (int i = 0; i < Counter; i++)
{
cellArr[i] = new Cell(i);
//Cell_Counter++;
}
}
onColumnCreate += new CreateColumn(Cell.Re_Linked_atColumn);
- is responsible for finding cell neighbors when creating a column.cellArr[i] = new Cell(i); - заполняем массив ячеек - ячейками
public static Cell[] cellArr = new Cell[Counter];
public static event CreateColumn onColumnCreate;
//public static int Cell_Counter=0;
int column;
public static int Counter;
Re_Linked_atColumn
I do the following:nt c = Column.Counter;
Column.Counter = c; - что бы помнить значение Counter и при создании нового столбца продолжать с того же места.
public class Cell
{
public static List<bool> west = new List<bool>();
public static List<bool> east = new List<bool>();
public static List<bool> north = new List<bool>();
public static List<bool> south = new List<bool>();
static int RowCount = 0;
static int ColumnCount = 0;
int Cell_Index;
public Cell(int Index)
{
this.Cell_Index = Index;
}
public int index
{
get { return Cell_Index; }
}
for (int i = 0; i < Counter; i++)
{
cellArr[i] = new Cell(i);
//Cell_Counter++;
} - смотрел под отладчиком - смотрел оно один раз заходит в Cell -в конструктор Cell и затем выкидывает из цикла с ошибкой :
System.IndexOutOfRangeException: "Index was out of range."
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question