public void Test() { var impor = new Importer(); var drawing = new Drawing(); string[] text = File.ReadAllLines(@"Tasks\Task22\spaceship.txt"); foreach (var line in text) { Console.WriteLine(line); } Console.ReadKey(); Console.Clear(); generat.ShowStatistics(text); CellLifeState[,] lifeState = new CellLifeState[generat.line, generat.sing]; Console.ReadKey(); Console.Clear(); impor.ImportCellMatrix(text, lifeState); DrawCellMatrix(lifeState); Console.ReadKey(); Wait(lifeState); }
private void IncrementIfAlive(ref int counter, CellLifeState cellLifeState) { if (cellLifeState == CellLifeState.Alive) { ++counter; } }
private void ReadyToFlow(CellLifeState[,] lifeState) { for (; ;) { var tempLifeState = new CellLifeState[lifeState.GetLength(0), lifeState.GetLength(1)]; for (int i = 0; i < generat.line; i++) { for (int a = 0; a < generat.sing; a++) { Movement(i, a, lifeState, tempLifeState); } } lifeState = tempLifeState; //Thread.Sleep(100); DrawCellMatrix(lifeState); } }
public void SetCellLifeState(int x, int y, CellLifeState cellLifeState) { _states[x, y] = cellLifeState; }