C# Class Minesweeper.Algorithms.MinefieldExtensions

Extends IMinefield and IMineArea to add some basic helper functions for enumerating objects.
ファイルを表示 Open project: jaegerpicker/CantonSoftwareMentorship

Public Methods

Method Description
AreasByColumn ( this minefield ) : IEnumerable

List all of the areas in a minefield by column.

AreasByRow ( this minefield ) : IEnumerable

List all of the areas in a minefield by row.

ClearAreas ( this minefield ) : IEnumerable

Lists all of the areas in a minefield that do not contain mines, sorted in row order, from left to right, top to bottom.

MineAreas ( this minefield ) : IEnumerable

Lists all of the areas in a minefield that contain mines, sorted in row order, from left to right, top to bottom.

NeighboringAreas ( this mineArea, IMinefield minefield ) : IEnumerable

Lists all of the areas that are adjacent to a mine area in a minefield.

Method Details

AreasByColumn() public static method

List all of the areas in a minefield by column.
public static AreasByColumn ( this minefield ) : IEnumerable
minefield this The minefield to enumerate.
return IEnumerable

AreasByRow() public static method

List all of the areas in a minefield by row.
public static AreasByRow ( this minefield ) : IEnumerable
minefield this The minefield to enumerate.
return IEnumerable

ClearAreas() public static method

Lists all of the areas in a minefield that do not contain mines, sorted in row order, from left to right, top to bottom.
public static ClearAreas ( this minefield ) : IEnumerable
minefield this The minefield to enumerate.
return IEnumerable

MineAreas() public static method

Lists all of the areas in a minefield that contain mines, sorted in row order, from left to right, top to bottom.
public static MineAreas ( this minefield ) : IEnumerable
minefield this The minefield to enumerate.
return IEnumerable

NeighboringAreas() public static method

Lists all of the areas that are adjacent to a mine area in a minefield.
public static NeighboringAreas ( this mineArea, IMinefield minefield ) : IEnumerable
mineArea this Returns the neighbors of this area.
minefield IMinefield Uses this minefield to get references to neighboring areas.
return IEnumerable