private void Initialize() { // Define the size of the Game chart // and fill the data structure with input data initChart = new GameChart(gameSize, dataIn); }
// ----------- // Constructors // ----------- // Copy constructor // This is USED public GameChart(GameChart c) { size = c.size; dataIn = c.dataIn; chart = new int[size, size]; Array.Copy(c.chart, chart, size * size); }
public void RetrievePreviousGame(Game backup) { hitsCollection = backup.hitsCollection.ToList(); allNumbers = backup.allNumbers.ToList(); initChart = backup.initChart; candidateNr = backup.candidateNr; hitsNr = backup.hitsNr; }
private void Show(GameChart initChart) { // I must show per columns and NOT per row as when I scan an array Console.WriteLine("----------------------"); for (int i = 0; i < gameSize; i++) { for (int j = 0; j < gameSize; j++) { Console.Write(initChart.GetElement(i, j) + " "); if (j == 2 || j == 5) { Console.Write("| "); } } Console.WriteLine(); if (i == 2 || i == 5 || i == 8) { Console.WriteLine("----------------------"); } } }
// Free the Backup List from on Chart // public void RemoveChartFromList(GameChart gchart) { chartList.Remove(gchart.chart); }
// // save the char in the List chartList // public void SaveChartInList(GameChart gchart) { // save the chartList.Add(gchart.chart); }
private void Show2(GameChart c) { Console.WriteLine("Output: " + initChart.ConvertToString()); }