public IEnumerable<Field> CurrentPlayerPlaces(IPlaceBlackStone blackStonePlacer)
 {
     var currentPlayer = _playersState.CurrentPlayer;
     var targetBorder = currentPlayer.GetTargetBorder(_fieldsGraph);
     return targetBorder.Select(() => blackStonePlacer.UpperIsTarget(_fieldsGraph),
                                () => blackStonePlacer.BottomIsTarget(_fieldsGraph))
         .Distinct()
         .Where(_fieldsGraph.CanPlaceBlackStone)
         .Select(_fieldsGraph.GetField);
 }
Example #2
0
        public IEnumerable <Field> CurrentPlayerPlaces(IPlaceBlackStone blackStonePlacer)
        {
            var currentPlayer = _playersState.CurrentPlayer;
            var targetBorder  = currentPlayer.GetTargetBorder(_fieldsGraph);

            return(targetBorder.Select(() => blackStonePlacer.UpperIsTarget(_fieldsGraph),
                                       () => blackStonePlacer.BottomIsTarget(_fieldsGraph))
                   .Distinct()
                   .Where(_fieldsGraph.CanPlaceBlackStone)
                   .Select(_fieldsGraph.GetField));
        }
Example #3
0
 public IEnumerable <Tuple <int, int> > BottomIsTarget(IFieldsGraph fieldsGraph)
 {
     return(_first.BottomIsTarget(fieldsGraph).Concat(_right.BottomIsTarget(fieldsGraph)));
 }