Пример #1
0
 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)));
 }
Пример #2
0
        public GameState Do(Covers covers)
        {
            var moves = _moves.Push(covers);

            return(new GameState(moves, CursorPosition));
        }
Пример #3
0
 public static GameState Start(MineField mineField)
 {
     return(GameState.Create(Covers.Create(mineField.Size)));
 }
Пример #4
0
 public static GameState Create(Covers covers)
 {
     return(new GameState(ImmutableStack.Create(covers), new Point(0, 0)));
 }