C# Class Minesweeper.Data_Access_Layer.RowMajorFileSerializer

An implementation of the IMinesweeperSerializer interface. IMinefields are loaded from a file path. Each line in the file contains a unique minefield. Minefields are in the following format: row,col;data row = number of rows in the minefield matrix col = number of columns in the minefield matrix data = a list of '*' and '.' characters. '*' indicates a mine cell, '.' indicates a clear cell. Cells are sorted in row major order.
Inheritance: IMinesweeperSerializer
Mostrar archivo Open project: jaegerpicker/CantonSoftwareMentorship Class Usage Examples

Public Methods

Method Description
Load ( ) : IEnumerable
RowMajorFileSerializer ( string path ) : System
Save ( IEnumerable fields ) : void

Private Methods

Method Description
HasMine ( char data ) : bool
PrintArea ( IMineArea area ) : string

Method Details

Load() public method

public Load ( ) : IEnumerable
return IEnumerable

RowMajorFileSerializer() public method

public RowMajorFileSerializer ( string path ) : System
path string
return System

Save() public method

public Save ( IEnumerable fields ) : void
fields IEnumerable
return void