示例#1
0
文件: ValidMoves.cs 项目: ngeor/games
 public IEnumerable<Cell> GetValidMoves(IGame game)
 {
     return
         from col in Enumerable.Range(0, game.ColumnCount)
         let cell = game.Cells().Where(c => c.Col == col && game[c] == BlockState.Empty)
             .OrderByDescending(c => c.Row)
             .FirstOrNull()
         where cell.HasValue
         select cell.Value;
 }
示例#2
0
文件: ValidMoves.cs 项目: ngeor/games
 public IEnumerable<Cell> GetValidMoves(IGame game)
 {
     return game.Cells().Where(cell => game[cell] == BlockState.Empty);
 }