private void CopyGrid(Playfield playfield) { for (int row = 0; row < this.size; row++) { for (int col = 0; col < this.size; col++) { this.grid[row, col] = playfield.GetCell(row, col); } } }
public GameEngine(IReader reader, IRenderer renderer, Playfield playfield) { this.reader = reader; this.renderer = renderer; this.playfield = playfield; }
/// <summary> /// Set size, and copy grid from passed playfield /// </summary> /// <param name="playfield"></param> public Memento(Playfield playfield) { this.size = playfield.Size; this.grid = new string[this.size, this.size]; this.CopyGrid(playfield); }