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);
 }
Esempio n. 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));
        }
Esempio n. 3
0
 public IEnumerable <Tuple <int, int> > UpperIsTarget(IFieldsGraph fieldsGraph)
 {
     return(_first.UpperIsTarget(fieldsGraph).Concat(_right.UpperIsTarget(fieldsGraph)));
 }