private static Covers UncoverDeep( this Covers covers, MineField mineField, Point point) { if (!covers.IsCovered(point)) { return(covers); } if (!mineField.IsEmptyAt(point)) { return(covers.Uncover(point)); } return(point .Neighbours(mineField.Size) .Aggregate( covers.Uncover(point), (current, neighbor) => current.UncoverDeep(mineField, neighbor))); }
public GameState Do(Covers covers) { var moves = _moves.Push(covers); return(new GameState(moves, CursorPosition)); }
public static GameState Start(MineField mineField) { return(GameState.Create(Covers.Create(mineField.Size))); }
public static GameState Create(Covers covers) { return(new GameState(ImmutableStack.Create(covers), new Point(0, 0))); }